Home

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

Posted by SteveHardie | On: Jun 24 2010

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 Comment

  1. WP Themes says:

    Nice post and this enter helped me alot in my college assignement. Say thank you you on your information.

Leave a comment