What is an HttpHandler in ASP.NET? Why and how is it used?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the simplest terms, an ASP.NET HttpHandler is a class that implements the
System.Web.IHttpHandlerinterface.ASP.NET HTTPHandlers are responsible for intercepting requests made to your ASP.NET web application server. They run as processes in response to a request made to the ASP.NET Site. 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.
ASP.NET offers a few default HTTP handlers:
You can create your own custom HTTP handlers that render custom output to the browser. Typical scenarios for HTTP Handlers in ASP.NET are for example
You implement the
IHttpHandlerinterface to create a synchronous handler and theIHttpAsyncHandlerinterface to create an asynchronous handler. The interfaces require you to implement theProcessRequestmethod and theIsReusableproperty.The
ProcessRequestmethod handles the actual processing for requests made, while the BooleanIsReusableproperty specifies whether your handler can be pooled for reuse (to increase performance) or whether a new handler is required for each request.