Click here to Skip to main content
15,915,019 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
web..config
HTML
<system.webserver>
    <modules runallmanagedmodulesforallrequests="true">
      <remove name="UrlRoutingModule" />
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
    <handlers>
      <add>
        name="UrlRoutingHandler"
        preCondition="integratedMode"
        verb="*" path="UrlRouting.axd"
        type="System.Web.HttpForbiddenHandler, System.Web,  
              Version=2.0.0.0, Culture=neutral,  
              PublicKeyToken=b03f5f7f11d50a3a"/>
    </add></handlers>
  </system.webserver>

Tried the following code under global.asax of application_start
C#
RouteTable.Routes.MapPageRoute("Category", "categories/{id}", "~/JobReport/WebForm1.aspx?id=longvalue");

and under page load of the page as
C#
Response.RedirectToRoute("Category", new { id = "1"});

But page isn't redirecting properly shown...
Posted
Updated 1-Mar-13 20:40pm
v2
Comments
Karthik Harve 2-Mar-13 2:40am    
[Edit] pre tags added.

1 solution

Read about it and follow the steps mentioned here: For ASP.NET 4.0: URL Routing[^]
 
Share this answer
 
Comments
Korathu 2 2-Mar-13 3:35am    
I tried all as said..But page isn't redirecting correctly

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900