Introduction
When I first started out, it was hard to find information on how to setup an
ASP.NET HTTP handler. Of course, after time, I've
found a wealth of articles, posts, and comments from others on these and other
related topics. As my second post in the
HTTP module/handler saga, I hope to give you an in-depth discussion on
the topic of handlers to include pros, cons, and a sample implementation that
you can extend.
Introduction
ASP.NET uses HTTP handlers to process all requests. For general information on
HTTP handlers (and modules), see my previous article,
Introduction to ASP.NET HTTP Modules and Handlers. In the following
sections, I will discussĀ a few pros and cons of HTTP handlers and provide
a step-by-step guide to implementing your own handler.
Most notably, HTTP handlers are beneficial because they provide a way to
interact with HTTP requests before they get to a web page. This can be very
nice, depending on what you need to do with the request. For instance, perhaps
there is a need for logging actions taken by users or controlling access to
individual files (i.e. images, executables). For the purposes of this article,
I will discuss using handlers for URL rewriting.
This is intended to be a work in progress, so let me know if there is something
extra that you'd like to see in it, or, if there are any
mistakes/inconsistencies. Any other feedback is welcome, as well.