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" />
精彩评论