Where should you put the validation control?

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?

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?

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

Explanation:



Leave a Reply 6

Your email address will not be published. Required fields are marked *


R

R

Shoud it be letter B? Because you only need to ensure that the users must input their username and password.

Bruno

Bruno

Letter A. Actually you must provide the validation in the server-side code, but as for a better user experience, it is also recommended to perform the validation in client-side code. This way the user won’t have to wait too much to realize that those information are missing.

@R

@R

Why do you need to put the validation in the server-side code? You just need to validate that the user inputs the username and password. I agree in server side if it will be a verification of the user input.

R

R

You just need to validate the username and password right? why do you need to use the server side code? It’s all in the client side code. Waste of effort putting that in the server side.

Ivica

Ivica

From version 2.0 on, ASP.NET recognized the JavaScript capabilities of these browsers, so client­-side validation is now available to all modern browsers, including Opera, Firefox, and others. Support is even better now in ASP.NET 4.0. That said, it’s important not to forget that JavaScript can be disabled in any browser, so client-­side validation cannot be relied upon– we must always validate any submitted data on the server.

DB7

DB7

Ivica nailed it!