开发者

Asp.net validation controls with client side validation in js not working properly

开发者 https://www.devze.com 2023-02-17 05:29 出处:网络
I am using asp.net required field validator controls in my page and i will use js confirm dialog box, if user click on cancel button then reset all dr开发者_开发百科opdowns of page .

I am using asp.net required field validator controls in my page and i will use js confirm dialog box, if user click on cancel button then reset all dr开发者_开发百科opdowns of page . then asp.net validation not working. i also use Page_ClientValidate() method in js function.

"after cancel confirmation i will try to save next records but this time validation not fire"

if i set DisplayMode Dynamic or static of validator then its working fine.

in case of DisplayMode is none its not working.

Please guide me where i am wrong.

kaushal


If you are using a return function, while calling a JavaScript function, then you should remove the return keyword:

For example:

OnClientClick="t();" 


This occurred to me when using ASP.NET 4.5. Turns out that there was a setting which I had to do in Web.config to make it work in asp.net 4.5. A workaround was to manage Page.IsValid in each postback.

<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
0

精彩评论

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