This is a mirror of official site: http://jasper-net.blogspot.com/

What is difference between HTTP Handler and HTTP Module

| Thursday, December 2, 2010
Here are the difference between HTTP Handlers and HTTP Modules.

Http Handlers:

Http handlers are component developed by asp.net developers to work as end point to asp.net pipeline. It has to implement System.Web.IHttpHandler interface and this will act as target for asp.net requests. Handlers can be act as ISAPI dlls the only difference between ISAPI dlls and HTTP Handlers are Handlers can be called directly URL as compare to ISAPI Dlls.

Http Modules:

Http modules are objects which also participate in the asp.net request pipeline but it does job after and before HTTP Handlers complete its work. For example it will associate a session and cache with asp.net request. It implements System.Web.IHttpModule interface.

HTTP Handler implement following Methods and Properties

  • Process Request: This method is called when processing asp.net requests. Here you can perform all the things related to processing request.
  • IsReusable: This property is to determine whether same instance of HTTP Handler can be used to fulfill another request of same type.

Http Module implements following Methods and Properties.
  • InIt: This method is used for implementing events of HTTP Modules in HTTPApplication object.
  • Dispose: This method is used perform cleanup before Garbage Collector destroy everything.

An Http Module can Support following events exposed to HTTPApplication Object.
  1. AcquireRequestState: This event is raised when asp.net request is ready to acquire the session state in http module.
  2. AuthenticateRequest: This event is raised when asp.net runtime ready to authenticate user.
  3. AuthorizeRequest: This event is raised when asp.net request try to authorize resources with current user identity.


Read more: DOTNETJAPS

Posted via email from .NET Info

0 comments: