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 der Auflistung hinzugefügt werden soll.

Ausnahmen

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

Beispiele

Das folgende Codebeispiel zeigt, wie Sie ein HttpHandlerAction Objekt erstellen und der Auflistung hinzufügen.

// 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 mit dem richtigen Namen und Typ initialisieren. Danach können Sie das soeben erstellte Objekt der Auflistung hinzufügen.

Note

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

Die Auflistung darf noch kein Objekt mit denselben HttpHandlerAction Eigenschaften Verb enthaltenPath.

Gilt für: