HttpHandlerActionCollection.Add(HttpHandlerAction) Methode

Definition

Fügt der Auflistung ein HttpHandlerAction-Objekt hinzu.

public:
 void Add(System::Web::Configuration::HttpHandlerAction ^ httpHandlerAction);
public void Add (System.Web.Configuration.HttpHandlerAction httpHandlerAction);
member this.Add : System.Web.Configuration.HttpHandlerAction -> unit
Public Sub Add (httpHandlerAction As HttpHandlerAction)

Parameter

httpHandlerAction
HttpHandlerAction

Das HttpHandlerAction-Objekt, das zur Auflistung hinzugefügt werden soll.

Ausnahmen

Das hinzuzufügende HttpHandlerAction-Objekt ist in der Auflistung bereits vorhanden, oder die Auflistung ist schreibgeschützt.

Beispiele

Das folgende Codebeispiel zeigt, wie Ein HttpHandlerAction Objekt erstellt und der Auflistung hinzugefügt wird.

// Add a new HttpHandlerAction to the Handlers property HttpHandlerAction collection.
httpHandlersSection.Handlers.Add(new HttpHandlerAction(
    "Calculator.custom", 
    "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", 
    "GET", 
    true));
' Add a new HttpHandlerAction to the Handlers property HttpHandlerAction collection.
httpHandlersSection.Handlers.Add(new HttpHandlerAction( _
    "Calculator.custom", _
    "Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", _
    "GET", _
    true))

Hinweise

Bevor Sie diese Methode verwenden, müssen Sie ein HttpHandlerAction Objekt erstellen und es mit dem richtigen Namen und Typ initialisieren. Danach können Sie das soeben erstellte Objekt der Auflistung hinzufügen.

Hinweis

ASP.NET sucht zuerst nach der Handlerassembly-DLL im privaten Bin-Verzeichnis der Anwendung und dann im Systemassemblycache.

Die Auflistung darf nicht bereits ein HttpHandlerAction Objekt mit den gleichen Verb Eigenschaften und Path enthalten.

Gilt für: