Which two code segments will achieve the goal?

You develop an ASP.NET MVC application. The application has a controller named
PeopleController.cs. The controller has an action method that returns a parent view. The parent
view includes the following code. Line numbers are included for the reference only.

The application also contains a partial view named People. The parent view must display the partial
view.
You need to add code at line 09 to display the partial view within the parent view.

Which two code segments will achieve the goal? Each correct answer presents a complete solution.

You develop an ASP.NET MVC application. The application has a controller named
PeopleController.cs. The controller has an action method that returns a parent view. The parent
view includes the following code. Line numbers are included for the reference only.

The application also contains a partial view named People. The parent view must display the partial
view.
You need to add code at line 09 to display the partial view within the parent view.

Which two code segments will achieve the goal? Each correct answer presents a complete solution.

A.
@{ Html.RenderPartial(“People”, Model);}

B.
@Html.Partial(“People”, Model)

C.
@Html.Display(“People”, Model)

D.
@Html.Raw(“People”)

Explanation:
By default, any partial view rendered by calling @Html.Partial(“PartialViewName”) will get the view
model passed to the parent view.
How to populate mvc razor partial view
http://stackoverflow.com/questions/13769707/how‐to‐populate‐mvc‐razor‐partial‐view



Leave a Reply 4

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


TERMINATOR

TERMINATOR

WRONG answer. Answer is A B.

FigArt

FigArt

I agree with the Terminator, A and B are the correct answers.

A writes direct to the response stream whereas B will buffer first and then write. Both will output a partial view