Zulfiqar Said..
ASP.NET request processing is based on a pipeline model in which ASP.NET passes http requests to all the HTTP modules in the pipeline. Each module receives the http request and has full control over it. The module can play with the request in any way it sees fit. Once the request passes through all of the HTTP modules, it is eventually served by an HTTP handler. The HTTP handler performs some processing on it, and the result again passes through the HTTP modules in the pipeline.
During the processing of an http request, only one HTTP handler will be called, whereas more than one HTTP modules can be called.
HttpHandlers
HTTP handlers are the .NET components that implement the System.Web.IHttpHandler interface. Any class that implements the IHttpHandler interface can act as a target for the incoming HTTP requests. HTTP handlers are somewhat similar to ISAPI extensions. It is commonly used for url rewriting and handling particular extension like '.merit' through asp.net.
you can Register the handler by adding the following text in the web.config file:
<httpHandlers>
<add verb="*" path="*.merit" type="MyHandler.NewHandler,MyHandler"/>
</httpHandlers>
HttpModules
HTTP modules are .NET components that implement the System.Web.IHttpModule interface. These components plug themselves into the ASP.NET request processing pipeline by registering themselves for certain events. Whenever those events occur, ASP.NET invokes the interested HTTP modules so that the modules can play with the request.
We can use and nodes for adding HTTP modules to our Web applications. In fact the modules are listed by using nodes in between and nodes.
<httpModules>
<add type="classname, assemblyname" name="modulename" />
</httpModules>
Here are two good articles that explains the details of HttpModules and HttpHandlers
http://www.15seconds.com/issue/020417.htm
http://www.codeproject.com/KB/aspnet/HttpModuleandHttpHandle.aspx