what are Httpmodule and HttpHandler?

Answers were Sorted based on User's Feedback



what are Httpmodule and HttpHandler?..

Answer / rituparno

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.

An HTTP handler can be either synchronous or asynchronous.
A synchronous handler does not return until it finishes
processing the HTTP request for which it is called. An
asynchronous handler runs a process independently of
sending a response to the user. Asynchronous handlers are
useful when you must start an application process that
might be lengthy and the user does not have to wait until
it finishes before receiving a response from the server.

Is This Answer Correct ?    33 Yes 3 No

what are Httpmodule and HttpHandler?..

Answer / sarat

HTTP Handler :

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. One difference between HTTP handlers
and ISAPI extensions is that HTTP handlers can be called
directly by using their file name in the URL.

HTTP handlers implement the following methods:
ProcessRequest - This method is actually the heart of all
http handlers.
IsReusable - This property is called to determine whether
this instance of http handler can be reused for fulfilling
another request of the same type. HTTP handlers can return
either true or false in order to specify whether they can be
reused.

We can use <httpHandlers> and <add> nodes for adding HTTP
handlers to our Web applications. In fact the handlers are
listed with <add> nodes in between <httpHandlers> and
</httpHandlers> nodes.
Ex: <httpHandlers>
<add verb="supported http verbs" path="path"
type="namespace.classname, assemblyname" />
<httpHandlers>
(In this verb=GET/POST/HEAD path=path for
incoming HTTP requests type=…)



HTTP Module :

Http modules are called before and after the http handler
executes. Http modules enable developers to participate in,
or modify each individual request. Http modules implement
the IHttpModule interface, which is located in the
System.Web namespace.

Available Events: BeginRequest, AuthenticateRequest,
AuthorizeRequest, EndRequest, etc.
Configuring HTTP Modules: In web.config
Ex: <system.web>
<httpModules>
<add name="MyModule"
type="MyModule.SyncModule, MyModule" />
</httpModules>
</system.web>
Creating HTTP Modules: To create an HTTP module, you must
implement the IHttpModule interface, The IHttpModule
interface has two methods with the following signatures:
void Init(HttpApplication);
void Dispose();

Is This Answer Correct ?    16 Yes 1 No

what are Httpmodule and HttpHandler?..

Answer / divya

http handler is a information between the web browser and
web server

Is This Answer Correct ?    16 Yes 25 No

Post New Answer

More ASP.NET Interview Questions

how to get the vb6.0 COM Component in to the .Net application?

3 Answers   iSoft,


What would be salary for 8+ years of experience in ASP.NET in different metro city in india?

0 Answers   Prompt Softech,


How can you handle errors in Web API?

0 Answers  


How does u call and execute a sp in .net?

0 Answers  


Explain the use of resource manager class in .net.

0 Answers  


How does http session work?

0 Answers  


How to use a Master Database in Asp.net?

0 Answers   MCN Solutions,


when the user control event occur in ASp page life cycle?

3 Answers   Microsoft,


Explain the purpose of storyboard.targetproperty.

0 Answers  


What is the lifespan for items stored in ViewState?

2 Answers   ISST,


What is the difference between server-side scripting and client-side scripting?

0 Answers  


When was asp.net released?

0 Answers  


Categories