Select from following answers:- routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" });
- routes.MapRoute("Default", "{controller}{action}{id}", new { controller = "Home", action = "Index", id = "" });
- routes.MapRoute("Default", "controller/action/id", new { controller = "Home", action = "Index", id = "" });
- routes.MapRoute("Default", "controller#action#id", new { controller = "Home", action = "Index", id = "" });
- All Above
When an MVC application first starts, the Application_Start() method is called. This method, in turn, calls the RegisterRoutes() method. The RegisterRoutes() method creates the route table.
The default route table contains a single route (named Default). The Default route maps the first segment of a URL to a controller name, the second segment of a URL to a controller action, and the third segment to a parameter named id.
Show Correct Answer
Source: http://www.asp.net/mvc/tutoria | Asked In: Company Online Tests |
Alert Moderator