Επεξεργασία

Κοινή χρήση μέσω


HttpHandlerActionCollection.IndexOf(HttpHandlerAction) Method

Definition

Gets the collection index of the specified HttpHandlerAction object.

public:
 int IndexOf(System::Web::Configuration::HttpHandlerAction ^ action);
public int IndexOf (System.Web.Configuration.HttpHandlerAction action);
member this.IndexOf : System.Web.Configuration.HttpHandlerAction -> int
Public Function IndexOf (action As HttpHandlerAction) As Integer

Parameters

action
HttpHandlerAction

The HttpHandlerAction object for which to get the collection index.

Returns

The collection index value.

Examples

The following code example shows how to obtain an HttpHandlerAction object collection index.


// Get the specified handler's index.
HttpHandlerAction httpHandler2 = new HttpHandlerAction(
"Calculator.custom",
"Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler",
"GET", true);
int handlerIndex = httpHandlers.IndexOf(httpHandler2);

'Get the specified handler's index.
Dim httpHandler2 As System.Web.Configuration.HttpHandlerAction  = new HttpHandlerAction( _
"Calculator.custom", _
"Samples.Aspnet.SystemWebConfiguration.Calculator, CalculatorHandler", _
"GET", _
true)
Dim handlerIndex As Integer = httpHandlers.IndexOf(httpHandler2)

Remarks

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

Applies to