jQuery-Validation-Engine icon indicating copy to clipboard operation
jQuery-Validation-Engine copied to clipboard

use it in asp.net updatepanel

Open Will-Lu opened this issue 15 years ago • 1 comments

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

Will-Lu avatar Sep 26 '11 07:09 Will-Lu

Thanks, but we are not supporting webforms

posabsolute avatar Sep 26 '11 13:09 posabsolute