Last post Oct 31, 2014 01:41 AM by Shawn - MSFT
Oct 30, 2014 08:09 AM|Gaurav Balyan|LINK
I am trying to implement Http Handler in an application and i am going through its details.
I am confused about some Points,
(1) Is Http Handler called for every request even if we have not implemented any handler
(2)when should we use Http Handlers
Oct 30, 2014 10:32 AM|sen338|LINK
Please read the below post, it may help you to understand HttpHandler and HttpModule
Oct 31, 2014 01:41 AM|Shawn - MSFT|LINK
(1) It depends.
An ASP.NET HTTP handler is the process that runs in response to a request that is made to an ASP.NET Web application. Each handler deals with the specified file.
Such as, the ASP.NET page handler is only one type of handler. ASP.NET includes several other built-in handlers such as the Web service handler for .asmx files.
For more information:
(2) ASP.NET handles all the HTTP requests coming from the user and generates the appropriate response for it. ASP.NET framework knows how to process different kind of requests based on extension, for example, It can handle request for
.aspx, .ascx and .txt files, etc. When it receives any request, it checks the extension to see if it can handle that request and performs some predefined steps to serve that request.
Now as a developer, we might want to have some of our own functionality plugged in. We might want to handle some new kind of requests or perhaps we want to handle an existing request ourselves to have more control on the generated response, for example,
we may want to decide how the request for .jpg or .gif files will be handled. Here, we will need an HTTPHandler to have our functionality in place.