views:

49

answers:

2

I want to check page validation on client side, like Page.Validate() but its server side method, is there any client side function which can work like Page.Validate() with javascript.

A: 

There is a mini-clientside-validation api: http://msdn.microsoft.com/en-us/library/aa479045.aspx#aspplusvalid_clientside

alt text

and here are some function to trigger validation on validators:

alt text

Tim Schmelter
A: 

Page_ClientValidate() will work. It returns true if the page was valid and it works fine.

If you are using ASP.NET 2.0, pass the validation group name as a parameter. e.g.

if(Page_ClientValidate("SomeValidationGroup"))
     alert('its valid');

otherwise if there is no validation group Page_ClientValidate("") will handle it. e.g.

if(Page_ClientValidate(""))
     alert('its valid');
Azhar