jquery对话框的问题

Pra*_*sad 5 asp.net-mvc jquery load dialog

我有一个带有下拉列表(带有Paid and unpaid选项)和一个按钮的局部视图.当用户单击Paid/Unpaid List link页面的子菜单时,我使用jquery load加载此局部视图.

当我在下拉列表中选择付费并单击按钮时,它会在jquery对话框中显示付费客户列表,如果我选择未付款并单击按钮,则会在jquery对话框中显示未付费客户.

我正在为对话框编写以下代码:

 $('#customers').dialog({
            bgiframe: true,
            autoOpen: false,
            open: function(event, ui) {
                //populate table
                var p_option = $('#d_PaidUnPaid option:selected').val();
                if (p_option  == 'PAID') {
                    $("#customercontent").html('');
                    //$("#customercontent").load("/Customer/Paid");
                }
                else if (p_option  == 'UNPAID') {
                    $("#customercontent").html('');
                    //$("#customercontent").load("/Customer/Unpaid");
                }
            },
            close: function(event, ui) {
                //do nothing
            },
            height: 500,
            width: 550,
            modal: true
        });
Run Code Online (Sandbox Code Playgroud)

我第一次在jquery对话框中正确获取列表,但是当我Paid/Unpaid List link再次单击并在下拉列表中选择Unpaid并单击按钮时,它会在jquery对话框中显示previos加载的内容.

我在这做错了什么?

Mar*_*arz 4

尝试向 jQuery AJAX 添加无缓存选项。我在使用 load() 函数(和 IE)时遇到问题,其中始终会显示缓存的结果。要更改所有 jQuery AJAX 请求的设置,请执行以下操作

$.ajaxSetup({cache: false});
Run Code Online (Sandbox Code Playgroud)