RegisterStartupScript("", "<script>alert('添加成功!');window.opener.location.href=window.opener.location='userManage.aspx';window.close();</script>");
RegisterStartupScript 允许 ASP.NET 服务器控件在 Page 中发出客户端脚本块。
window.opener.location.href
2个方法都是刷新父窗口,但是其中还是有奥妙的哦。
window.opener.location.reload();这个方法在强迫父窗口的时候,在有些IE浏览器(比如安全设置高)的情况下,会弹出一个确认对话框,提示是不是要重新再刷新一次页面,这可是比较郁闷的事情哦,我后来把这个方法替换成了window.opener.location.href=window.opener.location.href;
就不会出现那样的问题了。

本文介绍了两种在网页中刷新父窗口的方法:使用window.opener.location.reload()和window.opener.location.href=window.opener.location.href,并对比了这两种方法的效果,特别是在不同Internet Explorer版本中的表现。
7668

被折叠的 条评论
为什么被折叠?



