HttpHandlersSection Class [IIS 7 and higher]

Configures settings for ASP.NET handlers.

Syntax

class HttpHandlersSection : ConfigurationSectionWithCollection

Methods

The following table lists the methods exposed by the HttpHandlersSection class.

Name

Description

Add

(Inherited from ConfigurationSectionWithCollection.)

Clear

(Inherited from ConfigurationSectionWithCollection.)

Get

(Inherited from ConfigurationSectionWithCollection.)

GetAllowDefinition

(Inherited from ConfigurationSection.)

GetAllowLocation

(Inherited from ConfigurationSection.)

Remove

(Inherited from ConfigurationSectionWithCollection.)

RevertToParent

(Inherited from ConfigurationSection.)

SetAllowDefinition

(Inherited from ConfigurationSection.)

SetAllowLocation

(Inherited from ConfigurationSection.)

Properties

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

Name

Description

HttpHandlers

An array of HttpHandlerAction values that contain ASP.NET handlers.

Location

(Inherited from ConfigurationSection.) A key property.

Path

(Inherited from ConfigurationSection.) A key property.

SectionInformation

(Inherited from ConfigurationSection.)

Subclasses

This class contains no subclasses.

Remarks

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

The HTTP handlers in the HandlersSection class are related to IIS 7 and are in the <system.webServer> section of the ApplicationHost.config file. Each of these handlers is represented by an instance of the HandlerAction class.

Example

The following example displays HttpHandlersSection properties, including the HttpHandlerAction values that are in the HttpHandlers property.

' 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 Path and Location properties.
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
WScript.Echo 

' Display the HttpHandlerAction instances that are contained
' in the HttpHandlers property.
WScript.Echo "----------( Http Handlers )----------"
Counter = 0
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

ConfigurationSection

   ConfigurationSectionWithCollection

      HttpHandlersSection

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

ConfigurationSectionWithCollection Class [IIS 7 and higher]

HandlerAction Class [IIS 7 and higher]

HandlersSection Class [IIS 7 and higher]

HttpHandlerAction Class [IIS 7 and higher]