HttpModuleActionCollection.Add Method (HttpModuleAction)

 

Adds an HttpModuleAction object to the collection.

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

Public Sub Add (
	httpModule As HttpModuleAction
)

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

.NET Framework
Available since 2.0
Return to top
Show: