exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 2 question 1 discussion

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

DRAG DROP -
You need to implement the Views\RunLog\_CalculatePace.cshtml partial view from Views\Runlog\GetLog.cshtml to display the runner's average mile pace.
You have the following markup:

Which markup segments should you include in Target 1 and Target 2 to implement the view? To answer, drag the appropriate markup segments to the correct targets. Each markup segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Html.Partial renders the partial view as an HTML-encoded string.
This methodresult can be stored in a variable, since it returns string type value.
Simple to use and no need to create any action.
Like RenderPartial method, Partial method is also useful when the displaying data in the partial view is already in the corresponding view model.
References:
http://www.dotnettricks.com/learn/mvc/renderpartial-vs-renderaction-vs-partial-vs-action-in-mvc-razor

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
Jota
Highly Voted 5 years, 3 months ago
Hey admin! The application structure images are broken.. I have the files if you need...
upvoted 7 times
Tumpa
4 years, 6 months ago
Hi, Could you please share the files for preparing exam. [email protected]
upvoted 1 times
...
...
zimzimzimma
Highly Voted 4 years, 11 months ago
It should be @Html.Partial("_Calculatepace.cshtml", log). Only @Html.Partial("_Calculatepace", log) will give an error.
upvoted 7 times
...
tibo97
Most Recent 4 years, 3 months ago
that was a long buildup for that question
upvoted 1 times
...
rdhainaut
4 years, 3 months ago
You can see the full question here (with images) https://examref.com/MCSD/70-486/1
upvoted 1 times
...
zimzimzimma
4 years, 10 months ago
You can only leave away the .cshtml suffix if the view is located in _shared: http://dotnetmentors.com/mvc/how-to-use-partial-view-in-mvc-with-example.aspx Here the view is located in \Views\RunLog, so you need to apply the .cshtml suffix.
upvoted 3 times
steve1234
4 years, 8 months ago
The answer is correct. You can ignore the .cshtml extension when the partial is in the same folder. https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-3.1#:~:text=When%20referencing%20a%20partial%20view,folder%20supplies%20the%20partial%20view.&text=Relative%20paths%20are%20always%20relative,or%20parent%20of%20the%20file.
upvoted 4 times
rdhainaut
4 years, 3 months ago
Warning the documentation link do a distinction between razor pages and mvc 'pages'. In mvc application, in this scenario you must add .cshtml (because file is not in areas/areaName/Views/ControllerName, areas/areaName/Views/Shared, views/shared, pages/shared)
upvoted 1 times
...
...
...
pizzaHawai
4 years, 10 months ago
Answer is correct. No need to specify the .cshtml sufix. e.g.: https://www.c-sharpcorner.com/UploadFile/ff2f08/partial-view-in-mvc/
upvoted 5 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago