How you are redirecting to the Page
<a href='<%=ResolveUrl("~/Customers") %>'>View Customers</a>
If you write like above then it will show the url like this.
http://localhost:1932/RoutingCS/Customers
You need to set the Startup page as
Add this rout in the Sample
routes.MapPageRoute("Default", "Default", "~/Default.aspx");
Complete Global.aspx
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Default", "Default", "~/Default.aspx");
routes.MapPageRoute("Customers", "Customers", "~/Customers.aspx");
routes.MapPageRoute("CustomerDetails", "Customers/{CustomerId}", "~/CustomerDetails.aspx");
}
</script>
Download the sample and check