exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 2 question 11 discussion

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

You need to display the "miles" unit description after the distance in the GetLog view.
Which line of code should you use to replace line GL21? (Each correct answer presents a complete solution. Choose all that apply.)

  • A. @log.Distance miles
  • B. @Htrml.DisplayFor(model =>log.Distance) miles
  • C. @log.Distance.ToString() @Html.TextArea("miles")
  • D. @Html.DisplayFor(model => log.Distance.ToString() + " miles")
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️

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
pizzaHawai
4 years, 11 months ago
A & B are both correct. D is not possible and results in an error https://stackoverflow.com/questions/10797795/asp-net-mvc-3-razor-concatenate-string
upvoted 2 times
...
Phantasm
5 years, 2 months ago
a and d ??? d is working like charm. i tried. :)
upvoted 1 times
zimzimzimma
5 years ago
Yes it works but these are Microsoft questions, which often means that 1 out of 4 answers is total bollocks and the remaining 3 all work but 1 or 2 out of these are the way you SHOULD do it.
upvoted 1 times
...
mr_
4 years, 11 months ago
That was my first impression - A & D. But It is hard to say when some code is missing.
upvoted 1 times
mr_
4 years, 11 months ago
Sorry, my first impression was B & D. I would recommend to site owners to somehow merge that pop-up window with the question content to avoid such misleading info : - ).
upvoted 1 times
...
...
...
AT_TW
5 years, 3 months ago
B. @Htrml.... must be: @Html....
upvoted 3 times
...
Jobair
5 years, 3 months ago
Why A?
upvoted 1 times
majco333
5 years, 3 months ago
See Razor syntax: https://www.tutorialsteacher.com/mvc/razor-syntax
upvoted 1 times
...
tanujgyan
5 years ago
There is code snippet missing. There is a foreach with log as variable and that makes A correct
upvoted 2 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 ...