Many of these events can be sunk in the Global.asax of an application. By doing this, however, you limit the functionality to that application. To sink these events in a more reusable fashion, create an HttpModule. By adding a single line to the machine.config, your HttpModule affects all applications on the machine; by adding instead a single line to the web.config file, your HttpModule affects just that one application. The line to load an HttpModule looks like the following:
<httpModules> <add type="SimpleModules.SimpleHttpModule, SimpleModules" name="SimpleHttpModule" /> </httpModules>
Let's take a look at a couple of sample HttpModules that handle some of the events on this class.