public void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL w/ params new { controller="Home", action="Index",id="" } // Param defaults ); }
---------------------------------------------------------------------------------
| URL Controller Class Action Method Parameters Passed |
---------------------------------------------------------------------------------
/Dinners/Details/2 DinnersController Details(id) id=2
/Dinners/Edit/5 DinnersController Edit(id) id=5
/Dinners/Create DinnersController Create() N/A
/Dinners DinnersController Index() N/A
/Home HomeController Index() N/A
/ HomeController Index() N/A