Writing an HttpModule

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:

1.
Write a class that implements the IHttpModule interface. The IHttpModule interface has two methods: an Init method and a Dispose method.
2.
Implement a method in the class you wrote to handle the event you wish to capture.
3.
Add an entry in the Init method of your class to capture the event you wish to handle.
4.
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 ...

Get Special Edition Using® Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.