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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for