System.Web.Configuration Namespace
.NET Framework version 2.0
Configures an HTTP module for a Web application. This class cannot be inherited.
The HttpModulesSection class provides a way to programmatically access and modify the httpModules section of a configuration file.
This type is part of a group that includes the HttpModuleAction and HttpModuleActionCollection types.
NOTE: The HttpModulesSection can read and write information from and to the related section of the configuration file according to the section property AllowDefinition whose value is Everywhere.
This example demonstrates how to specify values declaratively for attributes of the add element within the httpModules section, which can also be accessed as members of the HttpModulesSection class.
The following configuration file example shows how to specify values declaratively for the httpModules section.
<httpModules>
<add name = "TimerModule"
type = "Samples.Aspnet.Configuration.RequestTimeInterval,
RequestTimeInterval Version=1.0.1557.23158, Culture=neutral,
PublicKeyToken=7bfb33146a87b52e, processorArchitecture=MSIL" />
</httpModules>
The following code example demonstrates how to use the HttpModulesSection class.
// Get the Web application configuration.
Configuration configuration =
WebConfigurationManager.OpenWebConfiguration ( "/aspnetTest" );
// Get the HttpModulesSection.
HttpModulesSection httpModulesSection =
( HttpModulesSection ) configuration.GetSection ( "system.web/httpModules" );
' Get the Web application configuration.
Dim configuration As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration ( "/aspnetTest" )
' Get the HttpModulesSection.
Dim httpModulesSection As HttpModulesSection = _
CType ( configuration.GetSection ( "system.web/httpModules" ), HttpModulesSection ) |
|
C# |
VB |
ASP.NET Configuration <httpModules> Section