Client side Javascript VS Server side vaoidation control in asp.net
-
Hi Friends.. I have doubt in validations. i want to use range validation in my page. so which one is best for checking range validation. either client side or server side validate controls.??? What is difference bw client side or server side validate controls??
Yours, KaNNaN ----------------------------------------------------------------- "Success is When Ur Signature Becomes An Autograph"
-
Hi Friends.. I have doubt in validations. i want to use range validation in my page. so which one is best for checking range validation. either client side or server side validate controls.??? What is difference bw client side or server side validate controls??
Yours, KaNNaN ----------------------------------------------------------------- "Success is When Ur Signature Becomes An Autograph"
KaNNaN.JC wrote:
which one is best for checking range validation. either client side or server side validate controls.???
Both Client side and server side validation must be there. Client side validation will help in better usability, because if user enters some wrong entry then you'll show the error message from client side itself.So there will be no postback. Server side is also required because say a user enters right entry from user interface but during posting the data to server some malicious user changed the entered value in some way, then in this case server side validation will be required.and wrong data would not be saved. Keep in mind, this will only take place when user enters right value from User Interface
Cheers!! Brij My Blog:http://brijbhushan.wordpress.com
Check my latest Article :ViewState - Various ways to reduce performance overhead -
Hi Friends.. I have doubt in validations. i want to use range validation in my page. so which one is best for checking range validation. either client side or server side validate controls.??? What is difference bw client side or server side validate controls??
Yours, KaNNaN ----------------------------------------------------------------- "Success is When Ur Signature Becomes An Autograph"
KaNNaN.JC wrote:
Hi Friends.. I have doubt in validations. i want to use range validation in my page. so which one is best for checking range validation. either client side or server side validate controls.??? What is difference bw client side or server side validate controls??
If you are using any of the Client Side validation control, please make sure you are using
Page.IsValidate
at the server side. If some one disable the javascript of browse, client side validator will never works as this runs on Javascript.Page.IsValidate
is ensure that each control validatation at server end. If use checkIf(Page.IsValidate)
{
// Validation all suceess
}
else
{
// Validation Fails
}When you Check for
Page.IsValidate
, ASP.NET CallValidate()
method for each and every control to ensure the validation pass, if one of them fails, it will return false. Hope this give you clear idea. Thanks !Cheers ! Abhijit Jana | MVP Visit My Blog Abhijit's World of .NET | Follow Me @ twitter | Disclaimer
-
KaNNaN.JC wrote:
Hi Friends.. I have doubt in validations. i want to use range validation in my page. so which one is best for checking range validation. either client side or server side validate controls.??? What is difference bw client side or server side validate controls??
If you are using any of the Client Side validation control, please make sure you are using
Page.IsValidate
at the server side. If some one disable the javascript of browse, client side validator will never works as this runs on Javascript.Page.IsValidate
is ensure that each control validatation at server end. If use checkIf(Page.IsValidate)
{
// Validation all suceess
}
else
{
// Validation Fails
}When you Check for
Page.IsValidate
, ASP.NET CallValidate()
method for each and every control to ensure the validation pass, if one of them fails, it will return false. Hope this give you clear idea. Thanks !Cheers ! Abhijit Jana | MVP Visit My Blog Abhijit's World of .NET | Follow Me @ twitter | Disclaimer
Hi friends, thanks for ur reply... i have used both client side and as well as server side controls. my doubt is which one is fast... i think validation control is not required for is post back method.
Yours, KaNNaN ----------------------------------------------------------------- "Success is When Ur Signature Becomes An Autograph"