HttpModule Fundamentals

   

An HttpModule is a method of implementing and registering a class that can handle events generated by the HttpApplication class during the processing of a request. When an event is generated, the HttpModule can do additional processing on the request. HttpModules provide similar functionality to ISAPI filters, but are much easier to design and implement. Because an HttpModule is a global object, it is used to do things that affect most ”if not all ”of the .aspx files in your application. Here is a partial list of things that you can do with an HttpModule:

  • Authorize files and authenticate users.

  • Maintain a collection of objects to be used by a given user (similar to the Session object).

  • Add a message to the bottom of every page that returns HTML data.

  • Encrypt data for pages of a certain type.

  • Centralize error logging for an application.

An HttpModule has two basic purposes. It provides event handlers for events that the Application object generates and can generate events that can be handled in your Global.asax file or the code file behind the Global.asax file. Both these purposes are discussed in detail in this chapter.

   


Special Edition Using ASP. NET
Special Edition Using ASP.Net
ISBN: 0789725606
EAN: 2147483647
Year: 2002
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net