nerdexam
Microsoft

70-515 · Question #36

You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that…

The correct answer is C. Create a class that implements the IRouteConstraint interface. See the full explanation below for the reasoning.

Question

You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contain an unrecognized country value will not be processed by the Details action of HomeController. What should you do?

Options

  • AAdd the ValidateAntiForgeryToken attribute to the Details action method.
  • BAdd the Bind attribute to the country parameter of the Details action method.
  • CCreate a class that implements the IRouteConstraint interface.
  • DCreate a class that implements the IRouteHandler interface.

How the community answered

(30 responses)
  • A
    3% (1)
  • B
    10% (3)
  • C
    80% (24)
  • D
    7% (2)

Community Discussion

No community discussion yet for this question.

Full 70-515 Practice