I am trying to make use of URL routing in my web forms application to make urls more user friendly. I would like to use the following mapping for one of my pages:
/services --> common/services.aspx
/services/seo --> common/services.aspx#seo
/services/hosting --> common/services.aspx#web-hosting
Can anyone please help me write the correct routing for this scenario? I would basically want to redirect the user to the different sections on the same page with different URLs as listed above.
Some of the URLs which are already working are:
//About Us
routes.MapPageRoute("", "about", "~/common/about.aspx", false);
//Contact Us
routes.MapPageRoute("", "contact", "~/common/contact.aspx", false);
Only the first one of the following works-
//Services - works
routes.MapPageRoute("", "services/{service}", "~/common/services.aspx", false);
//does not work
routes.MapPageRoute("", "services/web-development", "~/common/services.aspx#web", false);
routes.MapPageRoute("", "services/seo", "~/common/services.aspx#seo", false);
routes.MapPageRoute("", "services/digital-marketing", "~/common/services.aspx#marketing", false);
routes.MapPageRoute("", "services/web-development", "~/common/services.aspx#web", false); routes.MapPageRoute("", "services/seo", "~/common/services.aspx#seo", false); routes.MapPageRoute("", "services/digital-marketing", "~/common/services.aspx#marketing", false);