Specifies a class that handles run-time events in ASP.NET 2.0 and the current version of SharePoint Products and Technologies.
Real World Example
A development team needs to add hidden HTML tags to each page rendered in Microsoft Office SharePoint Server 2007, so they develop an HTTP module that is added to the page processing pipeline. The HTTP module intercepts each page request and inserts new data into the output stream.
HTTP modules exist within the page processing pipeline and handle various events raised by the system or by other modules. HTTP modules can also raise their own events that can be handled by other modules.
The following is an example of some HTTP module references in the web.config file of a SharePoint Web application.
<configuration> <system.web> … <httpModules> <clear /> <add name="SPRequest" type="Microsoft.SharePoint.ApplicationRuntime.SPRequestModule, Microsoft.SharePoint, Version=126.96.36.199, Culture=neutral, PublicKeyToken=71e9bce111e9429c" /> <add name="OutputCache" type="System.Web.Caching.OutputCacheModule" /> <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" /> <add name="Session" type="System.Web.SessionState.SessionStateModule" /> … </httpModules> … </system.web> </configuration>
More detailed information about HTTP modules can be found in the Microsoft .NET Framework SDK or in the book Programming Microsoft ASP.NET 2.0 Applications Advanced Topics (Esposito, 2006).
A HTTP module assembly can be installed in the Web application’s \bin directory or in the global assembly cache.
Because an HTTP module is always called as part of the page processing pipeline, a poorly designed or faulty module can have a detrimental effect on performance or perceived stability of the environment. Thoroughly test each module for performance before deploying it.