HttpHandlers and HttpModules
Web developers frequently think in terms of pages, but ASP.NET offers a framework that enables you to do virtually anything with an incoming HTTP request. Two special kinds of classes can extend the functionality of ASP.NET to do things other than serve pages.
HttpHandlers are special classes that do something with a request for a specific file type. You could in fact replace the entire page processing system by writing your own handler to process requests for .aspx pages.
HttpModules go to an even higher level by introducing code execution into the events of an HttpApplication object. Several built-in classes of the .NET Framework implement this to handle security details, as we'll do in our example.