Я закончил тем, что сделал это: измените Ajax.ActionLink
на Html.ActionLink
и в своем коде JavaScript я звоню $.get(theHREF, null, function () { refreshList() });
Вот код:
$("#dialog-confirm").dialog({
autoOpen: false,
resizable: false,
width: 500,
modal: true,
buttons: {
"Delete this item": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
$("[data-dialog-confirm]").click(function (e) {
e.preventDefault();
var theHREF = $(this).attr("href");
$("#dialog-confirm").dialog('option', 'buttons', { "Yes":
function () {
$.get(theHREF, null, function () { refreshList() });
$(this).dialog("close");
}, "No":
function () { $(this).dialog("close"); }
});
$("#dialog-confirm").dialog("open");
});
ВотMVC 3 ActionLink
@Html.ActionLink("Delete", "DeleteConfirmed", "Category", new { id = item.Id }, new
{
data_dialog_confirm = "true"
})