Compartir a través de


<httpModules> Element

Configures the HTTP modules within an application.

<configuration>
   <system.web>
      <httpModules>

<httpModules>
   <add type="classname,assemblyname" name="modulename"/>
   <remove name="modulename"/>
   <clear/>
</httpModules>

Subtags

Subtag Description
<add> Adds an HttpModule class to an application.

Note that if an identical verb/path combination has been specified earlier (for example in a Web.config file in a parent directory), the second call to <add> overrides the previous setting.

<remove> Removes an HttpModule class from an application.
<clear> Removes all HttpModule mappings from an application.

Example

The following example adds three HttpModule references to the ASP.NET application.

<configuration>
   <system.web>
      <httpModules>
         <add type="System.Web.Caching.OutputCacheModule" 
              name="OutputCache"/>
         <add type="System.Web.SessionState.SessionStateModule" 
              name="Session"/>
         <add type=Selector, selector.dll"
              name="Selector"/>
      </httpModules>
   </system.web>
</configuration>

Requirements

Contained Within: <system.web>

Web Platform: IIS 5.0, IIS 5.1, IIS 6.0

Configuration File: Machine.config, Web.config

Configuration Section Handler: System.Web.Configuration.HttpModulesConfigHandler

See Also

ASP.NET Configuration | ASP.NET Settings Schema