HttpModuleActionCollection.Add(HttpModuleAction) Method

Definition

Adds an HttpModuleAction object to the collection.

C#
public void Add(System.Web.Configuration.HttpModuleAction httpModule);

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.

C#
// 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();
}

Remarks

Adds an HttpModuleAction object to the collection.

Applies to

Tuote Versiot
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1