Javascript: How to use ASP.NET Forms Validation from Javascript

ASP.NET has a Page.Validate() method that is used to programatically validate an ASP.NET Form, however, Page.Validate() is a server side function and requires a postback. Its job is to run server side validation. So to run client-side validation, without causing a post back, we can use the javascript function Page_ClientValidate().

Call Page_ClientValidate(). It returns true if the validation is successful. If you are using ASP.NET 2.0, pass the validation group name as a parameter
Page_ClientValidate(“”) will handle when there is no group name.

1 thought on “Javascript: How to use ASP.NET Forms Validation from Javascript”

Comments are closed.