locked
How to use Http Handler RRS feed

  • Question

  • User583282017 posted

    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

    Thursday, October 30, 2014 8:09 AM

Answers

  • User-1818759697 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 31, 2014 1:41 AM

All replies

  • User-40287846 posted

    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/

    Thursday, October 30, 2014 10:32 AM
  • User-1818759697 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 31, 2014 1:41 AM