exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 5 question 1 discussion

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

You are developing an ASP.NET MVC application.
The application has a contact view includes a form for editing the displayed contact.
You need to save the Contact object model when the form is posted back to the EditContact method using a POST method request.
Which code segment should you use? Each correct answer presents a complete solution. Choose all that apply.

  • A. public ActionResult EditContact(){var c = newContact(){FirstName = Request.QueryString['"FirstName"'],LastName = Request.QueryString ["LastName"]},SaveContact(c);return View(c);}
  • B. public ActionResult EditContact(Contact c){SaveContact(c);return View(c);}
  • C. public ActionResult EditContact(FormCollection values){var c = newContact(){FirstName = values['"FirstName"'],LastName = values ["LastName"]},SaveContact(c);return View(c);}
  • D. public ActionResult EditContact(QueryStringProvider values){var c = newContact(){FirstName = values.GetValue['"FirstName"'],LastName = values.GetValue
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
advenios
Highly Voted 5 years, 5 months ago
Answer BC A is not correct. Question states "form is posted back to the EditContact method using a POST method request." and option A tries to read data for QueryString
upvoted 29 times
...
ex
Highly Voted 5 years, 5 months ago
Should be BC
upvoted 15 times
...
MantasV
Most Recent 4 years, 5 months ago
answer B&C
upvoted 2 times
...
Dev666
4 years, 11 months ago
The answer is BC BRO!
upvoted 3 times
...
aousos
5 years ago
BC is the answer
upvoted 3 times
...
reco40
5 years, 4 months ago
if the project was an 'API' it would be right, but project is an MVC and right answer is BC
upvoted 7 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