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:

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:

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



Leave a Reply 8

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


anon

anon

The last answer should be @item.Name.

@item will not display the friend name.

Muthukumar

Muthukumar

Yes. @item.Name

EYAuditor

EYAuditor

Yes. @item.Name

EYAuditor

EYAuditor

Verified by EY Auditor

Natasha

Natasha

@Model.Name, @foreach(var item in Model.Friends), @item.Name

Adolf

Adolf

Dear Admin,
Could you please upload some new dumps for this exam (70-486)?
Thank you in advance!