code_junkie

asp-mvc routing when hosted in IIS on development environment

Nov 14th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. routes.MapRoute("mvc-default", "{controller}.mvc/{action}/{id}"
  2. , new { controller = "Home", action = "Index", id = (string)null });
  3.  
  4.  
  5. routes.MapRoute("Root", ""
  6. , new { controller = "Home", action = "Index", id = (string)null });
  7.  
  8. HttpContext.Current.RewritePath(Request.ApplicationPath);
  9.  
  10. HttpContext.Current.RewritePath(Request.ApplicationPath, false);
  11.  
  12. routes.MapRoute(null, "{controller}.aspx/{action}");
  13. routes.MapRoute(
  14. "Default", // Route name
  15. "{controller}.aspx/{action}/{id}", // URL with parameters
  16. new { controller = "Home", action = "Index", id = "" } // Parameter defaults
  17. );
Add Comment
Please, Sign In to add comment