在div中关闭框架 [英] Close frame in div
本文介绍了在div中关闭框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个aspx页面.
在该页面中,单击链接时显示div.
Div包含iframe,我正在为该框架分配一个网址,如下所示.
I have an aspx page.
In that page I am displaying div when click on link.
Div contains iframe and I am assigning an url to the frame like below.
<asp:LinkButton ID="lkbtn" Text="Create" OnClientClick="return ShowDiv(this)" runat="server">
// Function to Show the Div //
function ShowDiv(CtrlName)
{
document.getElementById(''divUserCtrl'').style.display = ''inline'';
frames[''ifrm''].window.location = "CreateProject.aspx?ProjCat=G";
return false;
}
当我单击linkbutton时,我可以显示div并重定向到CreateProject页面,但是在CreateProject中,当我单击一个按钮时,我需要关闭该div.
我该如何在C#中做到这一点.我试过了:
When I click on linkbutton I am able to display div and redircting to CreateProject page but in CreateProject when I click on a button I need to close this div.
How can I do this in c#. I tried:
Page.RegisterStartupScript("Reload", "<script>window.close();</script>");
但没有运气:(
But no luck :(
推荐答案
使用Self代替window
Use Self instead of window
<a href="javascript:self.close()">Close </a>
这篇关于在div中关闭框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文