Software Development Fundamentals — Question 30
You have a website that includes a form for usemame and password.
You need to ensure that users enter their username and password. The validation must work in all browsers.
Where should you put the validation control?
Answer options
- A. in both the client-side code and the server-side code
- B. in the client-side code only
- C. in the Web.config file
- D. in the server-side code only
Correct answer: A
Explanation
The correct answer is A because implementing validation both on the client-side and server-side ensures that all users are validated regardless of their browser settings or JavaScript support. Relying solely on client-side validation (option B) may allow bypassing by users with JavaScript disabled. Options C and D do not provide comprehensive validation across different environments.