Partial View Refreshes after Jquery Ajax Post

a 夏天 提交于 2019-12-03 15:40:23

ajaxSuccess is a global handler which is called whenever a response for an ajax call is received. Performing another ajax call in it will definitely cause an infinite loop.

Probably the best option here is to update second table in the success handler of the first partial view:

function success(result) {
    $("#Partial_Analysis").html(result);

    reloadDisplayAverage();
}

function reloadDisplayAverage() {   
    var tdata = $('#form1').serialize();
    $.ajax({
        type: "POST",
        data: {
            mCollection: tdata,
        },
        url: "Home/PartialAverage",
        success: function (result) { success(result); }
    });

    function success(result) {
        $("#Display_Average").html(result);
    }
}

if the response is ajax response...then

   $.ajax({
                url: 'Home/PartialAverage',
                data: {mCollection: tdata,},
                type: 'POST',
                success: function (result) {

                    $("#Display_Average").html(data);
                }
            });

this should work for you..it did for me....

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!