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 cache and cookies?

0 Answers  


how to update data set?

3 Answers   IBM, TCS,


Explain page output caching?

0 Answers  


Where are session variables stored?

0 Answers  


How we handle the runtime database schema change issue in asp.net application?

2 Answers   IBM, Tech Mahindra,






what is the differance between .DLL & .EXE

10 Answers   Infinite Computer Solutions,


What is the compiled object?

0 Answers   eXensys,


Explain the disadvantages of viewstate?

0 Answers  


What is Web Server Control Templates.?

0 Answers   MCN Solutions,


Demonstrate Render and PreRender?

0 Answers   QuestPond,


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

0 Answers  


accessing a textbox that was created dynamically? for (int i = 0; i < t1; i++) { TextBox t2 = new TextBox(); t2.ID = "adf" + i; PlaceHolder1.Controls.Add(t2); } accessing data entered in the above created controls.

1 Answers  


Categories