exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 103 discussion

Actual exam question from Microsoft's 70-486
Question #: 103
Topic #: 1
[All 70-486 Questions]

HOTSPOT -
You develop an ASP.NET MVC application. You are creating a new layout page by using the Razor view engine.
The layout page has the following requirements:
✑ Render the content of a section named scripts at the bottom of the layout page.
✑ Render the content of a section named features just above the body of the page.
✑ Render a StyleBundle named /Content/css.
You need to implement the layout page.
How should you complete the relevant Razor markup? To answer, select the appropriate Razor markup from each list in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: @Styles.Render("~/Content/css")
Render a StyleBundle named ~/Content/css.
@Styles.Render("~/Content/css") is calling the files included in that particular bundle which is declared inside the BundleConfig class in the App_Start folder.
Box 2: @RenderSection("featured", true)
Render the content of a section named featured just above the body of the page.
RenderSection renders only a part child view that is wrapped under named section.
RenderSection() method includes boolean parameter "required" which makes the section optional or mandatory. If required parameter is true then the child view must contain the section.
Box 3: @RenderSection("scripts", false)
Render the content of a section named scripts at the bottom of the layout page.
References:
http://stackoverflow.com/questions/12028401/styles-render-in-mvc4 http://www.tutorialsteacher.com/articles/difference-between-renderbody-and-rendersection-mvc

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
saud_khan67
5 years, 3 months ago
Box 3 should be as follows: @RenderSection("scripts",false)
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...