Click here to Skip to main content
15,913,570 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I want to use RouteCollection in my asp.net web site.

What I have tried:

in Global.asax :

C#
void Application_Start(object sender, EventArgs e)
{
   RouteConfig.RegisterRoutes(RouteTable.Routes);
}

public static void RegistRoute(RouteCollection routes)
{
   routes.MapPageRoute("HomePage", "Home", "~/ClientSide/Forms/Index.aspx");
}


but when I want to address it in href="Home", I get Error the Page does not Exist.

What should I do ?
Posted
Updated 24-Dec-16 22:01pm

1 solution

You have to call EnableFriendlyUrls to routing to work in WebForms application...
 
Share this answer
 

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