@using (Html.BeginForm()) {
<p>
<input type="submit" value="OK" />
@Html.ActionLink("Back to List", "Index")
jquery代码是
$(".deleteimage").click(function (e) {
var url = $(this).parent().attr('href');
$("#dialog-delete").dialog({
resizable: false,
height: 180,
width: 300,
show: { effect: 'drop', direction: "up" },
modal: true,
draggable: false,
open: function (event, ui) {
$(this).load(url);
},
close: function (event, ui) {
$(this).dialog('close');
}
});
$("#dialog-delete").dialog('open');
return false;
});
在索引视图中使用此代码..
@(new HtmlString(@Ajax.ImageActionLink("../../Content/images/grid/Del.png", "Delete", "Delete", "Delete", new { id = item.TerminalID }, "deleteimage", new AjaxOptions
{
HttpMethod = "GET",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "targetdiv"
})))
答案 0 :(得分:1)
为了关闭jQuery UI对话框,您可以使用close方法:
$("#dialog-delete").dialog('close');