Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Webforms 4.0 Routing : How to get rid of physical urls

How would you accomplish these in ASP.NET Webforms 4.0 Routing;

  • .aspx pages should not be accesible directly, pages should be accesible only with routes,
  • Start page should be "/" or "/home" or something else, but not "Default.aspx".

Thanks.

like image 800
Alper Avatar asked Mar 29 '10 19:03

Alper


1 Answers

You can specify ignore routes to ignore routing for your static handlers, for the static content part (though routing, if the static file exists, normally gets routed directly to the file no problem).

I believe the method you want to use though is MapPageRoute for web forms, which is for web forms. See this for examples: http://msdn.microsoft.com/en-us/library/system.web.routing.routecollection.mappageroute%28VS.100%29.aspx

like image 172
Brian Mains Avatar answered Nov 15 '22 07:11

Brian Mains