Question

I got this in an interview question -- the question was more about what they do, which I didn't know beyond very vague terms. But after reading about them I'm still no closer to an understanding of what problems I would solve with an HttpHandler or HttpModule. I've worked a fair amount in ASP.NET but it's been a few years -- is this a large gap in my knowledge? Something that's been replaced by more current technology?

Clarification: what's a common problem in the ASP.NET world that would be much easier to solve with an HttpHandler as opposed to something you'd do in a webservice or an ajax call?

Was it helpful?

Solution

Believe it or not ASP.NET is built using HTTP handlers and HTTP modules to provide default ASP.NET behavior. For a good write-up, please see HTTP Handlers and HTTP Modules Overview:

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow