Writing an HttpModule is fairly straightforward, though complex issues can arise, depending on what you are trying to do. To write an HttpModule, you must do the following:
Write a class that implements the IHttpModule interface. The IHttpModule interface has two methods: an Init method and a Dispose method.
Implement a method in the class you wrote to handle the event you wish to capture.
Add an entry in the Init method of your class to capture the event you wish to handle.
Add an entry inside the <HttpModules> section of either your web.config or machine.config file to register your HttpModule. The entry should be in the web.config file to register the module for a single application. The entry should ...