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

Im folgenden Codebeispiel wird gezeigt, 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 sie mit dem richtigen Namen und dem richtigen Typ initialisieren. Danach können Sie das Objekt hinzufügen, das gerade zur Auflistung erstellt wurde.

Hinweis

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

Die Auflistung darf kein Objekt mit demselben und denselben Verb Path Eigenschaften enthaltenHttpHandlerAction.

Gilt für: