【发布时间】:2009-11-03 04:13:51
【问题描述】:
我有一个带有下拉菜单(Paid and unpaid 作为选项)和一个按钮的局部视图。
当用户在页面的子菜单中单击Paid/Unpaid List link 时,我正在使用 jquery 加载加载此部分视图。
当我在下拉菜单中选择付费并单击按钮时,它会在 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
});
我第一次在 jquery 对话框中正确获取列表,但是当我再次单击 Paid/Unpaid List link 并在下拉列表中选择 Unpaid 并单击按钮时,它会在 jquery 对话框中显示 previos 加载的内容。
我在这里做错了什么?
【问题讨论】:
标签: jquery asp.net-mvc dialog load