HttpHandlerActionCollection.IndexOf(HttpHandlerAction) Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee haalt u de verzamelingsindex van het opgegeven HttpHandlerAction object op.
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
Het HttpHandlerAction object waarvoor de verzamelingsindex moet worden opgehaald.
Retouren
De waarde van de verzamelingsindex.
Voorbeelden
In het volgende codevoorbeeld ziet u hoe u een index voor een HttpHandlerAction objectverzameling ophaalt.
// 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)
Opmerkingen
Voordat u deze methode gebruikt, moet u een HttpHandlerAction object met de juiste naam en het juiste type identificeren. Vervolgens kunt u dit object gebruiken om de verzamelingsindex op te halen.