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

What is the difference between application object and session object?

4 Answers   IBS,


What are Master pages? How to define a Master page?

3 Answers  


What is session in web technology?

0 Answers  


Write code to send e-mail from an asp.net application?

0 Answers  


What is the use of placeholder control? Can we see it at runtime?

0 Answers  






What are the different types of sessions in asp.net?

0 Answers  


What is difference b/w Data Grid in ASP.Net 1.1 and Gridview in 2.0

11 Answers   Bosch, IntraLogic,


Define machine.config in .net?

0 Answers  


Can asp.net work on an nt server?

0 Answers  


What is the difference between application and cache variables?

6 Answers   Astadia,


What is asp according to you?

0 Answers  


how to add cliet side event to server side? and how to register client script to sever side? wt difference these two

3 Answers   PSI Data Systems,


Categories