Share via


HttpHandlerAction Class [IIS 7 and higher]

Represents an ASP.NET HTTP handler.

Syntax

class HttpHandlerAction : CollectionElement

Methods

This class contains no methods.

Properties

The following table lists the properties exposed by the HttpHandlerAction class.

Name

Description

Path

A read-only string value that contains the path of a single URL or a wildcard string. A key property.

Type

A read/write string value that specifies a managed type for an HTTP handler. ASP.NET searches for the handler assembly DLL in the application's private \Bin directory first and then in the system assembly cache.

NoteNote:
The type reference is formed as follows (items in brackets are not required): Namespace.Typename, Assemblyname[,] [Version=x,] [Culture=y,] [PublicKeyToken=z] (for example, "ExampleNamespace.ExampleType, Example.Assembly, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%").

Validate

A read/write boolean value. true if ASP.NET waits to load the handler class until a matching request arrives; otherwise false. The default is true.

Verb

A read-only string value that specifies a comma-delimited list of HTTP verbs (for example, "GET, PUT, POST"). A wildcard ("*") represents all verbs. A key property.

Subclasses

This class contains no subclasses.

Remarks

Instances of this class are contained in the HttpHandlers property of the HttpHandlersSection class.

The HTTP handlers represented by the HttpHandlerAction class are specific to ASP.NET and are in the <system.web> section of the Web.config file. These handlers are contained in the HttpHandlersSection class.

The HTTP handlers represented by the HandlerAction class are related to IIS 7 and are in the <system.webServer> section of the ApplicationHost.config file. These handlers are contained in the HandlersSection class.

Example

The following example displays the HttpHandlerAction instances that are contained in the HttpHandlers property of the HttpHandersSection object.

' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")

' Get the HttpHandlersSection.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "HttpHandlersSection", oSection

' Display the HttpHandlerAction instances contained in the
' HttpHandlers property of HttpHandlersSection.
For Each oHttpHandler In oSection.HttpHandlers
     Counter = Counter + 1
     WScript.Echo "[" & Counter & "] Path: " & oHttpHandler.Path
     WScript.Echo "Type: " & oHttpHandler.Type
     WScript.Echo "Validate: " & oHttpHandler.Validate
     WScript.Echo "Verb: " & oHttpHandler.Verb
     WScript.Echo
Next

Inheritance Hierarchy

CollectionElement

   HttpHandlerAction

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

CollectionElement Class [IIS 7 and higher]

HandlerAction Class [IIS 7 and higher]

HandlersSection Class [IIS 7 and higher]

HttpHandlersSection Class [IIS 7 and higher]