HttpModuleActionCollection.Add(HttpModuleAction) Methode

Definition

Fügt der Auflistung ein HttpModuleAction Objekt hinzu.

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

Parameter

httpModule
HttpModuleAction

Das HttpModuleAction Modul, das der Auflistung hinzugefügt werden soll.

Ausnahmen

Es wurde versucht, ein HttpModuleAction Objekt hinzuzufügen, das bereits in der Auflistung vorhanden ist.

Beispiele

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

// Create a new module object.

HttpModuleAction ModuleAction = 
    new HttpModuleAction("MyModuleName", 
    "MyModuleType");
// Add the module to the collection.
if (!httpModulesSection.SectionInformation.IsLocked)
{
    modulesCollection.Add(ModuleAction);
    configuration.Save();
}
' Create a new module object.
  Dim ModuleAction As New HttpModuleAction( _
  "MyModuleName", "MyModuleType")
  ' Add the module to the collection.
  If Not httpModulesSection.SectionInformation.IsLocked Then
      modulesCollection.Add(ModuleAction)
      configuration.Save()
  End If

Hinweise

Fügt der Auflistung ein HttpModuleAction Objekt hinzu.

Gilt für: