页面a.aspx使用js弹出一个小窗体,方法:
window.showModalDialog('b.aspx', 'obj', 'dialogWidth=352px;dialogHeight=337px');页面b.aspx中一个确定OK按钮,想要实现:点击确定按钮,将父页面Email.aspx重定向一个页面:c.aspx,并关闭b.aspx页面。
OK按钮后台方法,使用window.opem()打开的b.aspx页面可以通过下面的方法实现,而使用showModalDialog却不行,求一个正解方法。 ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>window.opener.location.href='c.aspx';window.close();</script>");
window.showModalDialog('b.aspx', 'obj', 'dialogWidth=352px;dialogHeight=337px');页面b.aspx中一个确定OK按钮,想要实现:点击确定按钮,将父页面Email.aspx重定向一个页面:c.aspx,并关闭b.aspx页面。
OK按钮后台方法,使用window.opem()打开的b.aspx页面可以通过下面的方法实现,而使用showModalDialog却不行,求一个正解方法。 ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>window.opener.location.href='c.aspx';window.close();</script>");
window.dialogArguments.location.href=window.dialogArguments.location.href; ???自己 = 自己 ?那我要跳转的c.aspx放那里?
总结一种方法:a.aspx页面
<a href="javascript:skip(1)">打开b页面</a><script type="text/javascript">
function skip(i) {
var id = window.showModalDialog('b.aspx?typeId=' + i + '', 'obj', 'dialogWidth=352px;dialogHeight=337px');
if (id != null && id.length != 0) {
window.location.assign("c?id=" + id );
}
}
</script>
b.aspx页面 <base target="_self" />
<script type="text/javascript">
function back() {
window.returnValue = document.getElementById("ListID").value;
window.close();
}
</script><asp:Button ID="btnSure" runat="server" Text="" CssClass="sure" OnClientClick="back()" OnClick="btnSure_Click" />