Friday 14 May 2010

Calling Page_ClientValidate() from a custom JavaScript function

Page_ClientValidate() is the ASP.NET built-in JavaScript function which is executed to validate the form against validation controls before a postback. Page_ClientValidate() sets Page_IsValid property to false if a validation fails and stops the postback.

Page_ClientValidate() can be called manually from a custom script function to make sure the form passes the validation.

But there can be issues like alerting the error messages twice when this function is called from a custom fuction and onClick of the postback button (which happens automatically).

No comments:

Post a Comment