HttpHandlerActionCollection.IndexOf(HttpHandlerAction) Methode

Definition

Ruft den Auflistungsindex des angegebenen HttpHandlerAction Objekts ab.

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

Parameter

action
HttpHandlerAction

Das HttpHandlerAction Objekt, für das der Auflistungsindex abgerufen werden soll.

Gibt zurück

Der Indexwert der Auflistung.

Beispiele

Das folgende Codebeispiel zeigt, wie Ein Objektsammlungsindex HttpHandlerAction erhalten wird.


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

Hinweise

Bevor Sie diese Methode verwenden, müssen Sie ein HttpHandlerAction Objekt mit dem richtigen Namen und Typ identifizieren. Anschließend können Sie dieses Objekt verwenden, um den Auflistungsindex abzurufen.

Gilt für: