O'Reilly logo

Special Edition Using® Microsoft® ASP.NET by Richard Leinecker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required