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.
(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.
Member
140 Points
344 Posts
How to use Http Handler
Oct 30, 2014 08:09 AM|Gaurav Balyan|LINK
Dear,
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
Member
670 Points
281 Posts
Re: How to use Http Handler
Oct 30, 2014 10:32 AM|sen338|LINK
Hi,
Please read the below post, it may help you to understand HttpHandler and HttpModule
http://mvolo.com/developing-iis7-modules-and-handlers-with-the-net-framework/
All-Star
27134 Points
2676 Posts
Re: How to use Http Handler
Oct 31, 2014 01:41 AM|Shawn - MSFT|LINK
Hi,
(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:
http://msdn.microsoft.com/en-us/library/bb398986(v=vs.100).aspx#Features
(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.
For more information:
http://www.codeproject.com/Articles/335968/Implementing-HTTPHandler-and-HTTPModule-in-ASP-NET
Regards