Share via


HttpHandlerActionCollection.IndexOf(HttpHandlerAction) Méthode

Définition

Obtient l'index de collection de l'objet HttpHandlerAction spécifié.

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

Paramètres

action
HttpHandlerAction

Objet HttpHandlerAction dont il faut obtenir l'index de collection.

Retours

Valeur d'index de collection.

Exemples

L’exemple de code suivant montre comment obtenir un index de collection d’objets HttpHandlerAction .


// 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)

Remarques

Avant d’utiliser cette méthode, vous devez identifier un HttpHandlerAction objet avec le nom et le type appropriés. Vous pouvez ensuite utiliser cet objet pour obtenir son index de collection.

S’applique à