Home » Microsoft » 70-486 v.2 » Which code segment should you use?
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. Choose all that apply.)
A. Option A
B. Option B
C. Option C
D. Option D
Correct Answer: CD
Explanation/Reference:
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