HttpModuleActionCollection.IndexOf Method (HttpModuleAction)


Gets the collection index of the specified HttpModuleAction module.

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

public int IndexOf(
	HttpModuleAction action


Type: System.Web.Configuration.HttpModuleAction

The HttpModuleAction module for which to get the collection index.

Return Value

Type: System.Int32

The collection index value for the specified module.

Before using this method, you must identify an HttpModuleAction module with the proper name and type. You can then use this module object to get its collection index.

The following example shows how to obtain an HttpModuleAction module collection index.

// Set the module object.
HttpModuleAction ModuleAction1 = 
    new HttpModuleAction("MyModule1Name",
// Get the module collection index.
int moduleIndex = modulesCollection.IndexOf(ModuleAction1);

.NET Framework
Available since 2.0
Return to top