Microsoft
70-519 · Question #126
You are designing an ASP.NET MVC 2 Web application. The Web application must meet the following requirements: - Validate all user input for a class named Customer. - Perform client-side and…
The correct answer is C. Add DataAnnotations attributes to each property in the Customer class. See the full explanation below for the reasoning.
Question
You are designing an ASP.NET MVC 2 Web application. The Web application must meet the following requirements:
- Validate all user input for a class named Customer.
- Perform client-side and server-side validation.
You need to recommend an approach for validating user input. What should you recommend?
Options
- AAdd DataAnnotations attributes to each property in the Customer class.
- BUse only strongly typed HTML helpers.
- CAdd DataAnnotations attributes to each property in the Customer class.
- DUse ASP.NET validation server controls.
How the community answered
(38 responses)- A3% (1)
- B13% (5)
- C79% (30)
- D5% (2)
Community Discussion
No community discussion yet for this question.