HttpModuleActionCollection.Add(HttpModuleAction) Metoda

Definicja

HttpModuleAction Dodaje obiekt do kolekcji.

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)

Parametry

httpModule
HttpModuleAction

Moduł HttpModuleAction do dodania do kolekcji.

Wyjątki

Podjęto próbę dodania HttpModuleAction obiektu, który już istnieje w kolekcji.

Przykłady

W poniższym przykładzie pokazano, jak utworzyć HttpModuleAction obiekt i dodać go do kolekcji.

// 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

Uwagi

HttpModuleAction Dodaje obiekt do kolekcji.

Dotyczy