AuthorizationRuleCollection.IndexOf Method (AuthorizationRule)

 

Gets the collection index of the specified AuthorizationRule object.

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

public int IndexOf(
	AuthorizationRule rule
)

Parameters

rule
Type: System.Web.Configuration.AuthorizationRule

The AuthorizationRule object whose index is returned.

Return Value

Type: System.Int32

The index of the specified AuthorizationRule object.

The following code example shows how to use the IndexOf method.

// Get the rule collection index.
System.Int32 ruleIndex = 
    authorizationSection.Rules.IndexOf(authorizationRule);

.NET Framework
Available since 2.0
Return to top
Show: