Skip to content

What is the difference between HttpApplication IHttpModule IHttpHandler

1 June 2011

This was a question I was asked recently and here I’m trying to distinct them in brief.

HttpModule is a simple class implementing IHttpModule  interface. This interface provides initialization and disposal events. Initialization is used to attache handlers to events which integrated pipeline raises (these are all the events that are exposed by the HttpApplication object – as BeginRequest and EndRequest),  enabling HttpModule  to work in IIS 7.0 Integrated mode.

HttpHandler requires (this is the one difference) to be mapped to a particular file extension – established through the web.config file –  and needs an entry point to get into the handler’s code.  This entry point is the HTTP endpoint – actually the last stop for the incoming Http requests – and is the other difference.

HttpApplication is a class implementing IHttpAsyncHandler and IHttpHandler (and another two) and is used as a base class for applications (most of the time as a base class of the Global class in Global.asax file). HttpApplication class are instantiated in the ASP.NET infrastructure and is not supposed to be created by the user directly.


From → ASP.NET, IIS7

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: