Generic Handlers in ASP.NET


In this blog we will try to learn about URL mappings by using Generic Handlers in ASP.NET.

Handlers will be used to manipulate incoming requests and pass requests from one page to another page.

Typically it maintains all HTTP Module functions.

Conceptual View

Find sample execution for dynamic mapping:

In this mapping we need to give configuration at web.config level. So that your request enables you to transfer.
  1. <system.web>  
  2.    <urlMappings enabled="true">  
  3.       <add url="~/Home.aspx" mappedUrl="~/ReqHandler.ashx"/>  
  4.    </urlMappings>  
  5. </system.web>  
Prepare a solution and give startup page to Home.aspx.

Now your request is transfered to Handler from Home.aspx. Just execute your home page and check it once.