Question 78


2.1.1 Question

Multiple Choices

Layout.cshtml and Site.Master are the two default template pages in ASP.NET MVC. Which of the following scenarios would best be solved using a single layout or master template? (Choose all that apply.)

  • A. Your application has a requirement to display a menu section that changes based on the area of the application the user is visiting.
  • B. Each content area on your page needs a header that displays the company’s branded color and contains the first 40 characters of the content area’s content followed by an ellipsis.
  • C. You have created a set of styles, each in a different style sheet. The styles need to be available to every page in the application.
  • D. Your application has three different default page designs: two rows of information, two columns of information, and three columns of information.

Answer:

AC
Explanation
A. Correct: Adding logic to the master page to determine the menu design enables your application to display a menu section that changes based on the area of the application the user is visiting.
B. Incorrect: The master page does not have the capability to “look” into the content sections and select the first 40 characters.
C. Correct: Referencing all style pages in a single place, the layout page, is an appropriate use.
D. Incorrect: A master page does not control the design of the content being displayed.