我有一个 jQuery 对话框,其中包含 html 表。当我单击对话框的确定按钮时,我需要将此表传递给代码后面的方法。这是我尝试过的:
$("#custom-modal").dialog({
height: 200,
modal: true,
buttons: { "OK": function () {
var table1 = $("#customTable").val();
$.ajax({
type: "POST",
url: "MyPage.aspx/BindCustom",
data: ({ param1: table1 }),
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
},
success: function (result) {
alert("success");
}
});
$(this).dialog("close");
return true;
}, "Cancel": function () {
$(this).dialog("close");
return false;
}
}
});
BindCustom 是背后代码的 webmethod。但它甚至没有被调用。请帮忙...