开发者

How to check Page.Validate() on client side (JavaScript) in ASP.Net?

开发者 https://www.devze.com 2023-01-20 22:30 出处:网络
I want to check page validation on client side, like Page.Validate() but it\'s a server side method. Is there any 开发者_StackOverflow社区client side function which can work like Page.Validate() with

I want to check page validation on client side, like Page.Validate() but it's a server side method. Is there any 开发者_StackOverflow社区client side function which can work like Page.Validate() with JavaScript?


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');


There is a mini-clientside-validation API:

http://msdn.microsoft.com/en-us/library/aa479045.aspx#aspplusvalid_clientside

How to check Page.Validate() on client side (JavaScript) in ASP.Net?

and here are some functions to trigger validation on validators:

How to check Page.Validate() on client side (JavaScript) in ASP.Net?

0

精彩评论

暂无评论...
验证码 换一张
取 消