exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 53 discussion

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

You are developing an ASP.NET MVC application that enables you to edit and save a student object.
The application must not retrieve student objects on an HTTP POST request.
You need to implement the controller.
Which code segment should you use? Each correct answer presents a complete solution.

A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: CD
C: This is the default MVC implementation of having separate methods for GET and POST via function overloading.
D: We retrieve the GET and POST methods through this.HttpContext.Request.RequestType.
Incorrect:
Not A: We retrieve the GET and POST methods through this.HttpContext.Request.RequestType, not through this.HttpContext.Request["ActionName"].
Reference: Examining the Details and Delete Methods
http://www.asp.net/mvc/overview/getting-started/introduction/examining-the-details-and-delete-methods

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
Correct anwser is C & D. The letter is below the screenshot.
upvoted 4 times
...
zimzimzimma
5 years ago
Also note that there is a difference in naming between ASP.NET MVC and ASP.NET Core. In .NET Core, 'RequestType' does not exist. It is 'Method'. Only in ASP.NET MVC 'RequestType' exists. Confusing.
upvoted 2 times
...
hungry_ape9000
5 years ago
FINAL ANSWER: B is correct Any other solution is bad practice. You shouldn't check the RequestType property in the controller like that and D is not even here.
upvoted 1 times
mr_
4 years, 12 months ago
I disagree. The question is not about what is the good practice but rather which are the possible ways to achieve the goal. Last answer fulfills that requirement so is correct in my opinion. I saw lot of questions from MS that promoted bad practices so that one seems not to be exception. By the way - I have some sort of experience with MS exams and usually when the question is like "Select all that apply" it is really likely that there is more than single correct answer. It is not general rule but I have a feeling that assuming that there will be more than one may be good practice when taking MS exams. So I would say last two answers are correct and letters are assigned wrongly - first answer is skipped and to the second "A" has been assigned (should be "B" probably and so on).
upvoted 2 times
...
...
rhysabray
5 years, 3 months ago
C and D are the correct answers, if you can overlook all the 'c' instead of 's' typos in every answer choice that is..
upvoted 3 times
...
ilCorvo
5 years, 3 months ago
B is also wrong since the retrieve returns variable s, which is undeclared.
upvoted 1 times
...
Kaine
5 years, 4 months ago
C is also wrong since the retrieve returns variable s, which is undeclared. Perhaps I'm just being pedantic...
upvoted 3 times
...
Kaine
5 years, 4 months ago
D is wrong since the variable c [c = RetrieveStudent(id)] is undeclared and the view being returned has no reference to argument s when saving a student.
upvoted 3 times
...
Nunu95
5 years, 4 months ago
B and C.
upvoted 1 times
...
Nunu95
5 years, 4 months ago
Where is D???
upvoted 1 times
...
AdLentis
5 years, 6 months ago
Correct answers are B and C; these match the description in the answer. D is missing.
upvoted 1 times
mmniet
5 years, 6 months ago
Nope, the letters are behind the answers, so C and D is correct
upvoted 16 times
XXXX
5 years, 3 months ago
I agree
upvoted 1 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 ...