What is HttpHandler
HTTPHandlers are integral components of the ASP.NET web application server responsible for handling specific requests based on file extensions. These handlers operate as processes that execute in response to incoming requests made to an ASP.NET website. Implementing the System.Web.IHttpHandler interface, an HTTPHandler is a class that can serve as the target for incoming HTTP requests.
Functioning as extension-based processors, HTTPHandlers are tasked with fulfilling requests originating from web browsers, depending on the specific file extensions involved. When an HTTPHandler receives a request from a browser, it examines the file extension to determine if it is capable of handling the request, subsequently executing predefined steps to generate an appropriate response.
The ASP.NET framework provides several default HTTP handlers, with the most commonly encountered being the ASP.NET page handler designed for processing .aspx files. These default handlers streamline the handling process for various file types and contribute to the seamless operation of ASP.NET web applications. Following are some default Handlers:
How to implement HTTPHandler ?
Any class that implements the IHttpHandler interface can perform as a target for the incoming HTTP requests. The class should have a method ProcessRequest and a property called IsReusable.C# Source Code
IsReusable property return either true or false in order to specify whether they can be reused and ProcessRequest is called to process http requests.