What's the route to catch the default page?
I don't want to use the default route that vs .net creates:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
I only need a route to get the www.example.com/ page, what is it? (note: I don't want www.example.com/default to just equal www.example.com to map to HomeController Action = Index).
0
BestPractise
source
to share
1 answer
I just started playing with MVC yesterday (beta) and I have this in my web config (for IIS 6.0, remove .aspx for IIS 7.0)
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute("Default", "{controller}.aspx/{action}/{id}", new { controller = "Home", action = "Index", id = "" });
routes.MapRoute("Empty", "", new { controller = "Home", action = "Index", id = "" });
}
+1
source to share