我在mvc 4中使用带有crud选项的Jquery Modal弹出窗口。当单击关闭按钮时它关闭,并且URL显示为#。
一旦我(X)点击并关闭,它将显示如下的URL。然后我再也无法弹出模态。
url:“localhost:56950 /#”
Referances:
<link href="@Url.Content("~/Content/themes/base/minified/jquery-ui.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script>
Jquery代码:
$("#openDialog").live("click", function (e) {
e.preventDefault();
var url = $(this).attr('href');
$("#dialog-edit").dialog({
title: 'Add Customer',
autoOpen: false,
resizable: false,
height: 355,
width: 400,
show: { effect: 'drop', direction: "up" },
modal: true,
draggable: true,
open: function (event, ui) {
$(this).load(url);
},
close: function (event, ui) {
$(this).dialog('close');
window.opener.location.reload();
}
});
$("#dialog-edit").dialog('open');
return true;
});
MVC代码:
<p>
@Html.ActionLink("Create New", "Create", "Home", null, new { @id = "openDialog" })
</p>
<div id="dialog-edit">
</div>
请帮我解决这个问题..