Monday, May 12, 2008

differences between httphandlers and httpmodules?

HTTP Handlers - These are used for handling HTTP request with specified file type. e.g. There is one HTTP handler for aspx file, anothter http handler for .axd(trace) file, another one for asp file.HTTP Modules: These are used as filters which intercepts each http request before it is passed onto HTTP handlers regardless of file type. They are used for filtering incoming requests. Typeical use would be logging requests, authentication etc. for each and every incoming requests.

An ASP.NET HTTP handler is the process (frequently referred to as the "endpoint") that runs in response to a request made to an ASP.NET Web application. The most common handler is an ASP.NET page handler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. You can create your own HTTP handlers that render custom output to the browser.
An HTTP module is an assembly that is called on every request that is made to your application. HTTP modules are called as part of the ASP.NET request pipeline and have access to life-cycle events throughout the request. HTTP modules let you examine incoming and outgoing requests and take action based on the request.

No comments: