HttpModuleActionCollection.Add(HttpModuleAction) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds an HttpModuleAction object to the collection.
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)
Parameters
- httpModule
- HttpModuleAction
The HttpModuleAction module to add to the collection.
Exceptions
An attempt was made to add an HttpModuleAction object that already exists in the collection.
Examples
The following example shows how to create an HttpModuleAction object and add it to the collection.
// 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
Remarks
Adds an HttpModuleAction object to the collection.
Applies to
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.