后台调用JS 关模式闭子窗口,刷新页面!!!急!!!

netstrive 2012-06-25 04:36:02
Response.Write("<script>window.opener.location.href=window.opener.location.href;window.close();</script>");

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "info", "window.opener.location.href='Profe/Professor/ProDetail.aspx';window.close();", true);


我以上都不行 ! 都会重新打开 一个新的页面! 注意:('Profe/Professor/ProDetail.aspx')是父页面!
...全文
301 21 打赏 收藏 转发到动态 举报
写回复
用AI写文章
21 条回复
切换为时间正序
请发表友善的回复…
发表回复
X技术交流X 2013-08-02
  • 打赏
  • 举报
回复
引用 20 楼 netstrive 的回复:
解决了 要配合 base 用
怎么配合base用 让小伙伴们都知道知道..
netstrive 2012-06-29
  • 打赏
  • 举报
回复
解决了 要配合 base 用
netstrive 2012-06-26
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 的回复:]
window.self.parent.frames[1].modalWindow.hiddle(); 试试看能关闭么?
[/Quote]也是一样的 打开一个 模式子窗口 管不了原来的窗口
想念旧时光 2012-06-26
  • 打赏
  • 举报
回复
window.self.parent.frames[1].modalWindow.hiddle(); 试试看能关闭么?
孟子E章 2012-06-26
  • 打赏
  • 举报
回复
注意要发能够运行的代码,如果有数据库,包括数据库,别发那种不能运行的
孟子E章 2012-06-26
  • 打赏
  • 举报
回复
发你的代码到
amxh@21cn.com
netstrive 2012-06-26
  • 打赏
  • 举报
回复
我打开关闭都试了! 就是不行!
孟子E章 2012-06-26
  • 打赏
  • 举报
回复
<script>
showModalDialog("xx.aspx")
window.location.href="b.aspx"
</script>
能弹出新窗口?

window.location.href不是写在showModalDialog里面的

安全的做法

xx.aspx里面写
<frameset rows="0.*">
<frame src=""/>
<frame src="子页面的地址a.aspx"/>
</frameset>

a.aspx里面怎么操作都不会有弹出的
netstrive 2012-06-26
  • 打赏
  • 举报
回复
实验了! 没实验还不被你们骂死!
孟子E章 2012-06-26
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 netstrive 的回复:]

引用 8 楼 的回复:
window.location.href="Profe/Professor/ProDetail.aspx"

showModalDialog里面写window.top.close()
应该是不会弹的
我要弹出模式窗口 window.location.href="Profe/Professor/ProDetail.aspx"

这样是打开 不能这样
[/Quote]

这句是关闭showModalDialog执行的,不是打开,你实验了没有??
netstrive 2012-06-25
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 的回复:]
window.parent.close()
window.location.href="Profe/Professor/ProDetail.aspx"
[/Quote] 会打开 和子窗口一样的窗口不会关闭 子窗口
  • 打赏
  • 举报
回复
window.parent.close()
window.location.href="Profe/Professor/ProDetail.aspx"
netstrive 2012-06-25
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 的回复:]
window.location.href="Profe/Professor/ProDetail.aspx"

showModalDialog里面写window.top.close()
应该是不会弹的
[/Quote]我要弹出模式窗口 window.location.href="Profe/Professor/ProDetail.aspx"

这样是打开 不能这样
孟子E章 2012-06-25
  • 打赏
  • 举报
回复
window.location.href="Profe/Professor/ProDetail.aspx"

showModalDialog里面写window.top.close()
应该是不会弹的
netstrive 2012-06-25
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 的回复:]
window.showModalDialog("xx.aspx")
window.location.href=window.location.href;
就可以了

xx.aspx只需window.close()
[/Quote]这样负页面能刷新 但是 子页面要手动才能关闭 还会弹出一个 本页面是否关闭的对话框!
孟子E章 2012-06-25
  • 打赏
  • 举报
回复
也可以
window.showModalDialog("xx.aspx",window)

xx.aspx
里面
var a = window.dialogArguments
a.location.href=a.location.href;
window.close()
孟子E章 2012-06-25
  • 打赏
  • 举报
回复
window.showModalDialog("xx.aspx")
window.location.href=window.location.href;
就可以了

xx.aspx只需window.close()
孟子E章 2012-06-25
  • 打赏
  • 举报
回复
window.showModalDialog()谁告诉你的可以使用window.opener啊?
netstrive 2012-06-25
  • 打赏
  • 举报
回复
window.showModalDialog()
孟子E章 2012-06-25
  • 打赏
  • 举报
回复
你的子页面是怎么打开?window.opener只能是window.open打开的才能使用
加载更多回复(1)

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧