我能够在对话框中显示一个剃刀页面,但是现在的问题是,当我单击对话框中的“确定”按钮时,不会触发OnPost方法。
function setPopup(url, formId, windowTitle) {
var opt = {
title: windowTitle,
autoOpen: false,
resizable: false,
height: 550,
width: 600,
show: { effect: 'drop', direction: "up" },
modal: true,
draggable: true,
open: function (event, ui) {
$(this).load(url);
},
buttons: [{
text: "Cancel",
click: function (event, ui) {
$(this).dialog('close');
}
},
{
text: "Ok",
type: "submit",
//class: "btn-success",
click: function (event, ui) {
$.validator.unobtrusive.parse($('#' + formId));
$("#" + formId).submit; //submit should trigger the OnPost method
}
}],
close: function (event, ui) {
$(this).dialog('close');
}
};
return opt;
}