PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant code?

HOTSPOT
You develop an ASP.NET MVC application that includes the following class. Line numbers are included for
reference only.

You must use the Razor view engine to display all property values for the class.
You need to implement the view.
How should you complete the relevant code? To answer, select the appropriate code segment from each list in
the answer area.
Hot Area:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
The @model directive provides a clean and concise way to reference strongly-typed models from view files.
Box 1: @Model.Name
Box 2: @foreach (var item in Model.Friends)
Box 3: @item
We can pass only one argument to the Razor template and it can be accessed through the @item parameter.
http://prideparrot.com/blog/archive/2012/9/simplifying_html_generation_using_razor_templates
http://odetocode.com/blogs/scott/archive/2013/01/09/ten-tricks-for-razor-views.aspx

19 Comments on “How should you complete the relevant code?


Leave a Reply