asp.net关闭模态子窗口后自动刷新父窗口
1个回答
展开全部
直接在父窗口写代码来实现
<head runat="server">
<title></title>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript">
$(function () {
$("#test").click(function () {
var str = window.showModalDialog("Dialog.aspx", "dialogWidth=200px;dialogHeight=100px");
if (str == undefined) {
window.location.href = window.location.href;
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" value="单击弹出模态窗口" id="test" />
</div>
</form>
</body>
<head runat="server">
<title></title>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript">
$(function () {
$("#test").click(function () {
var str = window.showModalDialog("Dialog.aspx", "dialogWidth=200px;dialogHeight=100px");
if (str == undefined) {
window.location.href = window.location.href;
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" value="单击弹出模态窗口" id="test" />
</div>
</form>
</body>
追问
我使用gridview绑定链接,还要传值,你想的太简单了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询