简体   繁体   中英

How to stop Wizard Redirecting to Next page

i am using wizard [two pane form] for data crud operation using ajax and asp.net .

Problem is : How to stop wizard moving to next page on success?

Explanation:

when i press save button given in wizard, when all data is stored into database it shows the success response on next page . which is not good in my case. I want to show the response using alert but it moves to next page to show the ajax response message.

Save button CODE :

 <button type="button" id="btnSave" class="btn bg-teal-400 stepy-finish">Save <i class="icon-check position-right"></i></button> 

Ajax Save Request Code:

  $("#dialogForm").on("click", "#btnSave", function () { var form = $('#frmCashPaymentVoucher'); var url = form.attr('action'); var formData = form.serialize(); $.ajax({ type: 'POST', url: url, dataType: 'html', data: formData, success: function (data) { $('#dialogForm').html(data); $('#modal_backdrop').modal('show'); //alert(data); }, cache: false }); }); 

Please Help me Out ..

Use This Code

$("#dialogForm").on("click", "#btnSave", function () {

        debugger;


            form = $('#frmCashPaymentVoucher');
            var url = form.attr('action');
            var formData = form.serialize();

            $.ajax({
                url: url,
                type: "POST",
                data: formData,
                contentType: false,
                processData: false,
                async: false,
                success: function(data) {

                    $('#dialogForm').html(data);
                    $('#modal_backdrop').modal('show');
                    //alert(data);

                },
                error: function(err) {
                    alert("Failed to load ...!!!");
                }
            });


        });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM