70-515 · Question #34
You create a new ASP.NET MVC 2 Web application. The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference only.) 01 public static void…
The correct answer is C. Replace line 05 in the Global.asax.cs file with the following line of code. See the full explanation below for the reasoning.
Question
You create a new ASP.NET MVC 2 Web application. The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference only.) 01 public static void RegisterRoutes(RouteCollection routes) 02 { 03 routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 05 routes.MapRoute("Default", "{controller}/{action}/{id}", new {controller = "Home", action = "Index", id = ""}); 06 } You implement a controller named HomeController that includes methods with the following signatures. public ActionResult About() public ActionResult Index() public ActionResult Details(int id) You need to ensure that the About action is invoked when the root URL of the site is accessed. What should you do?
Options
- AAt line 04 in the Global.asax.cs file, add the following line of code.
- BAt line 04 in the Global.asax.cs file, add the following line of code.
- CReplace line 05 in the Global.asax.cs file with the following line of code.
- DReplace line 05 in the Global.asax.cs file with the following line of code.
How the community answered
(38 responses)- A8% (3)
- B5% (2)
- C84% (32)
- D3% (1)
Community Discussion
No community discussion yet for this question.