multiple page routing not working in asp.net
i have a multiple asp.net web form i am trying to route of all but first page can route work rest of theme all are not working
What I have tried:
by code
Globle.asax
void Application_Start(object sender, EventArgs e)
{
RegisterProductRoutes(RouteTable.Routes);
}
public static void RegisterProductRoutes(RouteCollection routeCollection)
{
routeCollection.MapPageRoute("RouteForCatagory", "bath-accessories-{CategoryName}", "~/ProductInner.aspx");
routeCollection.MapPageRoute("RouteForProduct", "kp/{Product}-{CategoryName}", "~/ProductDetails.aspx");
}
First.aspx
<a href='<%# GetRouteUrl("RouteForCatagory", new {CategoryName = ReplaceSpace(Eval("CategoryName")).Trim()})%>'><%# Eval("CategoryName").ToString().Trim() %></a>
Second.aspx
<a href='<%# GetRouteUrl("RouteForProduct", new {ProductName = ReplaceSpace(Eval("ProductName")).Trim(),CategoryName = ReplaceSpace(Eval("CategoryName")).Trim()})%>'><%# Eval("ProductName").ToString().Trim() %></a>