Name
<httpModules>
Synopsis
<httpModules>
<add
name=moduleName
type=typeInfo />
<remove name=moduleName />
<clear />
</httpModules>Adds or removes HttpModules.
HttpModules are special classes that participate
in the processing of all application requests. Both ASP.NET caching
and session state are implemented as HttpModules, as are the
authentication and authorization features of ASP.NET.
Scope
Any
Attributes
None
Child Elements
-
<add> Adds an HttpModule. The class that implements the HttpModule is specified by the
typeattribute. This class must implement the IHttpModule interface. Thenameattribute provides an alias by which the HttpModule can be referred to -- for example, in a later<remove>element.-
<remove> Removes a previously configured HttpModule, based on the specified
nameattribute. The attribute must match a previously configured<add>element.-
<clear> Clears all previously configured HttpModules.
Example
The example removes the HttpModule for the Session state provider, which can be useful if you’re not using it:
<configuration>
<system.web>
<httpModules>
<remove name="Session" />
</httpModules>
</system.web>
</configuration>Notes
If you’re not using a particular HttpModule, such as
the Session state module or authentication modules, you may be able
to save overhead by removing these HttpModules from an
application’s web.config file
by using the <remove> element.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access