HttpModuleActionCollection.Add Method (HttpModuleAction)

 

Adds an HttpModuleAction object to the collection.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public void Add(
	HttpModuleAction httpModule
)

Parameters

httpModule
Type: System.Web.Configuration.HttpModuleAction

The HttpModuleAction module to add to the collection.

Exception Condition
ConfigurationException

An attempt was made to add an HttpModuleAction object that already exists in the collection.

Adds an HttpModuleAction object to the collection.

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

.NET Framework
Available since 2.0
Return to top
Show: