Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i use url rewrite code in my project as below
C#
protected void Application_Start(object sender, EventArgs e)
       {
           RegisterRoutes(RouteTable.Routes);

       }
void RegisterRoutes(RouteCollection routes)
       {
           routes.MapPageRoute("RestaurantRoute", "Restaurant/{City}/{RestaurantName}/{id}", "~/Restaurant/Restaurant.aspx",
               new RouteValueDictionary { { "id", "17348" } },         // default value
               new RouteValueDictionary { { "id", @"^\d+$" } });   // constraint e.g. only numerals

       }

it works, but links on Restaurant.aspx page are changed. my actual image link is
C#
<img id="Img2" src="~/Image/locationico.png" height="20"  runat="server" />

after using url rewrite it takes something like that
C#
<img id="Img2" src="~/Restaurant/{City}/{RestaurantName}/{id}/Image/locationico.png" height="20"  runat="server" />


please help me to solve problem
Posted

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