What should you do?

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.)

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?
A. At line 04 in the Global.asax.cs file, add the following line of code.
routes.MapRoute("Default4Empty", "/", new {controller = "Home", action = "About"});
B. At line 04 in the Global.asax.cs file, add the following line of code.
routes.MapRoute("Default", "", new {controller = "Home", action = "About"});
C. Replace line 05 in the Global.asax.cs file with the following line of code.
routes.MapRoute("Default4Empty", "{controller}/{action}/{id}", new {controller = "Home", action = "About", id = ""});
D. Replace line 05 in the Global.asax.cs file with the following line of code.
routes.MapRoute("Default", "{controller}/{action}", new {controller = "Home", action = "About"});

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.