一个window嵌套iframe 关闭window 怎么解决

fanshun21 2011-08-31 01:21:01
前台代码:
JS部分:
function SS()
{
win = new Ext.Window({
id:"win",
title:'截图',
modal:true,
width:550,
height:400,
html : "<iframe src='A.aspx' frameborder='0' width='100%' scrolling='no' height='100%' id='openwin'></iframe>"
});
win.show();
}
EXT部分:
<ext:Button ID="btnCreateLogo" Text="生成Logo" runat="server"><%--
<AjaxEvents>
<Click OnEvent="CreateLogo_Click" />
</AjaxEvents>--%>
<Listeners>
<Click Handler="SS()" />
</Listeners>
</ext:Button>
现在我点击按钮弹出window并显示页面A。ASPX. 我现在点击A.ASPX页面里面的提交按钮,怎么才能关闭这个window。
我用window.close();试过不行,window。parent。close()也不行。在线等。。。
...全文
267 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fanshun21 2011-08-31
  • 打赏
  • 举报
回复
3楼得方法OK,谢了
我姓区不姓区 2011-08-31
  • 打赏
  • 举报
回复
父页面

var win;

function SS() {
win = new Ext.Window({
id: "win",
title: '截图',
modal: true,
width: 550,
height: 400,
html: "<iframe src='A.aspx' frameborder='0' width='100%' scrolling='no' height='100%' id='openwin'></iframe>"
});
win.show();
}

function closeWin(){
if(win != null){
win.close();
}
}

A.aspx

window.parent.closeWin();
fanshun21 2011-08-31
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 ojlovecd 的回复:]

window.top.close();
[/Quote]
这个和parent的效果一样,整个页面都关了
我姓区不姓区 2011-08-31
  • 打赏
  • 举报
回复
window.top.close();

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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