Why do we have to specify the defaults for the default route?
This is a normal default route:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
Why can't I just do this:
routes.MapRoute(
name: "Default",
url: "Home/Index/{id}",
defaults: new {id = UrlParameter.Optional }
);
I already specified the action and controller but when I use this way, I get an error. Does anyone know why you have to specify the action and controller in the default
route?