jQuery-Validation-Engine
jQuery-Validation-Engine copied to clipboard
use it in asp.net updatepanel
Hi, when I use it in asp.net updatepanel, althrough the page doesn't pass the validation,the form still submit. I edit it on the function :"_onSubmitEvent". By adding the follow content, it works all right in updatepanel.
//get asp.net Ajax instance
var pm = Sys.WebForms.PageRequestManager.getInstance();
if (r) {
//if no error, recovery with "set_cancel(false)".
if (!pm.get_isInAsyncPostBack())
pm.add_initializeRequest(function (sender, args) { args.set_cancel(false); });
} else {
//if already async postback ,abort it; otherwise, initialize with "set_cancel(true)".
if (pm.get_isInAsyncPostBack())
pm.abortPostBack();
else
pm.add_initializeRequest(function (sender, args) { args.set_cancel(true); });
}
Thanks, but we are not supporting webforms