validation, is it better to have client side or use server side validator controls


 Hi All.
 I want to do validation on text boxes etc. Is it better to do client side validation or just use the server side validation controls?
 
0
aspd
4/16/2008 2:46:40 PM
📁 asp.net.web-forms
📃 93655 articles.
⭐ 6 followers.

💬 2 Replies
👁️‍🗨️ 1627 Views



Hi! 
If for server side controls you mean RequiredFieldValidator, CompareValidator, RegularExpressionValidator, etc.. i can tell you that they use client and server validation.
For instance if you use a RequiredFieldValidator, on the client will be a validation, but on the server this condition will be evaluated again. Probably one of the objetives of this is deal with client with javascript disabled.
Of course I recommend you to use these controls if you can achive with them what are you looking for.
 

Regards,
Claudio

Simplicity: "the art of maximizing the amount of work not done."
0
crfenix
4/16/2008 2:56:18 PM

The only reason for client side validation is to give the user an immediate response with out doing a postback. As the above poster said, the validation controls are reevaluated on the server to ensure they are correct. You should always validate on the server, becuase if the browser has javascript disable, all your validation logic will not work and the server will process your page as if it were valid.

-wili
0
awilinsk
4/16/2008 3:00:27 PM
Reply: