Last post Apr 18, 2007 05:41 AM by DMW
Apr 18, 2007 03:53 AM|sithender|LINK
Please friends i am getting so much confussion in IHttpModules and IHttphandlers and HttpApplication. i am getting confussion on the life cycle of request and response and the relation b/w the handlers , modules and HttpApplication.
Thanks & regards
Apr 18, 2007 05:41 AM|DMW|LINK
Handlers (which implement the IHttpHandler interface, and include such items as your .aspx page handlers) are the endpoints which service a request, typically generating a response such as a chunk of HTML, a PDF or an image.
Before the request hits a handler, it goes through a processing pipeline that is controlled by the HttpApplication object. This fires a series of events, which modules (that implement IHttpModule) can listen to. Note that modules can also process events
that are raised after the handler has serviced the request. Typical services provided by modules include security checking, caching and session state management.
You should note that there are multiple HttpApplication objects within the ASP.NET worker process (actually one per thread used to service requests), each with its own identical set of modules.
To summarise, think of the HttpApplication object as the controller that oversees the entire request; the modules as providing pre- and post-request processing; and the handler as being the object that reads the input request and generates the main output