Are validation server controls better than javascript in any way ? Do
they restrict us as we are only able to use the functionality that is
provided by them. Please help me on this. I read about validation
server controls from http://jai-on-asp.blogspot.com/2009/12/validation-controls-in-aspnet.html
Ok Point taken that we should have both server and client side
validations. But the by what way we decide that we use validation
controls or just javascript. One point thats coming to my mind is that
of compatibility with different browsers....and updation and
maintainability of them.
After chatting with my friends at Microsoft i got the following good
point. One issue that comes up is that if we use javascript in a .js
file we can reuse it in the entire application, on the other hand if we
use the validation controls and give them some particular settings and
they are to be used in entire application then we have to again and
again write those settings in each and every page ! ... still trying to
find a perfect answer...
Loading
Kirtan PatelPosted Dec 31, 2009, 3:05 AM
thats true that client side validation are faster then the server side validation but ..
think about security point .
Javascript can be disabled by WebSite User at that time it will allow data without any validation as user has disabled the validations
now at this point Server side controls are more secure as Validation Process is done at Server so No chance that user can enter bogus data for Haking the Website using Some SQL Injection Stuff.
so its depends on the situation .. which type of validations are to be used ..but when banking transaction like process is needed strongly recommend to use Server side validations
if my answer helps you then check "Do you like this answer" check box :)
Munwar ZardariPosted Dec 31, 2009, 2:31 AM
in my openion client side validation is better then serverside, because when u request to server by pressing button or other control,it is necessary that first it check that whether the entered data is valid or not, if it is not valid then should not go to server but reply that is data is incorrect. but if u apply serverside validation then it will validate data at server side , if data is not valid then it why u are sending request to server it is only resources consumption.
Santhosh NPosted Dec 30, 2009, 12:31 AM
1) client side validation is minimum passing criteria like whether the data is avaliable or not and certain type of data (just format)
2) Server side validation is for those which require actual data comparision..
coming to the complications involved in client side validation, you can always write a common .js file for all pages and call those functions by passing the control ids...
Raunak JhawarPosted Dec 29, 2009, 3:17 AM
If network bandwith is not PoC(Point of Concern) Opt Server side scripting
Anand ThakurPosted Dec 29, 2009, 12:45 AM
Regards,Anand