Export (0) Print
Expand All
Expand Minimize

HttpModulesSection Class [IIS 7 and higher]

IIS 7.0

Contains ASP.NET modules.

class HttpModulesSection : ConfigurationSectionWithCollection

The following table lists the methods exposed by the HttpModulesSection 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.)

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

Name

Description

Location

(Inherited from ConfigurationSection.) A key property.

HttpModules

An array of HttpModuleAction values that contain ASP.NET modules.

Path

(Inherited from ConfigurationSection.) A key property.

SectionInformation

(Inherited from ConfigurationSection.)

This class contains no subclasses.

The modules in the HttpModulesSection class are specific to ASP.NET and are in the <system.web> section of the Web.config file. Each of these modules is represented by an instance of the HttpModuleAction class.

The modules in the ModulesSection class are related to IIS 7 and are in the <system.webServer> section of the ApplicationHost.config file. Each of these modules is represented by an instance of the ModuleAction class.

The following example displays HttpModulesSection properties, including the HttpModuleAction values that are in the HttpModules property.

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

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

' Display the Path and Location properties.
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
WScript.Echo

' Display the HttpModuleAction instances that are contained
' in the HttpModules property.
WScript.Echo "----------( Http Modules )----------"
Counter = 0
For Each oHttpModule In oSection.HttpModules
     Counter = Counter + 1
     WScript.Echo "[" & Counter & "] Name: " & oHttpModule.Name
     WScript.Echo "Type: " & oHttpModule.Type
     WScript.Echo
Next

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

Community Additions

ADD
Show:
© 2014 Microsoft