Multiple choice technology web technology

In which file do we write code to associate a different layout for mobile devices in MVC3?

  1. Global.asax.cs

  2. web.config

  3. _Layout.cshtml

  4. _ViewStart.cshtml

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In MVC3, the _ViewStart.cshtml file is used to specify which layout file to render. To associate a different layout for mobile devices, you would add code in _ViewStart.cshtml to check the request browser and conditionally set a different layout file. Options A and B are configuration files not used for view logic, and option C is a layout file itself, not the place to assign layouts.