C# 提交代码后从另一页关闭iframe

C# 提交代码后从另一页关闭iframe,c#,html,asp.net,iframe,web-applications,C#,Html,Asp.net,Iframe,Web Applications,我有一个web应用程序,它有一个按钮,可以打开iframe窗体窗口 open.aspx是单击的按钮 supervisor.aspx是使用iframe打开的页面 open.aspx <div style="vertical-align: middle; text-align: center; left: 500px; width: 122px; position: absolute; top: 560px; height: 50px; z-index: 126; right: 889px;

我有一个web应用程序,它有一个按钮,可以打开iframe窗体窗口

open.aspx是单击的按钮

supervisor.aspx是使用iframe打开的页面

open.aspx

<div style="vertical-align: middle; text-align: center; left: 500px; width: 122px; position: absolute;  top: 560px; height: 50px; z-index: 126; right: 889px; font-size: 50pt; font-family: Calibri; font-weight: bold;" id="uncheckbutton">
    <asp:ScriptManager ID="ScriptManager1" runat="server">  
</asp:ScriptManager>  
      <asp:Button ID="Button1" runat="server" Text="UNCHECK" />
//this is the onclick button to open the iframe


<cc1:ModalPopupExtender ID="mp1" runat="server" PopupControlID="Panl1" TargetControlID="Button1"  
    CancelControlID="Button2" BackgroundCssClass="Background">  
</cc1:ModalPopupExtender> 



  <asp:Panel ID="Panl1" runat="server" CssClass="Popup" align="center" style = "display:none">  
    <iframe style=" width:400px; height: 150px;" id="irm1" src="Uncheck popup.aspx"  runat="server"> </iframe> 
         <asp:button Top="100px" id="button2" runat="server" text="CLOSE"  />  
</asp:Panel>  

如果主管为真,如何自动关闭iframe?现在我使用按钮点击来关闭,我想避免点击次数减少

我尝试过使用javascript,但尽管函数可以工作,但iframe仍然无法关闭。 我正在关注这个链接,并且


谢谢

我从asp.net获得了Yu Yongqing()的指南,建议我在iframe页面上创建一个js方法,调用iframe页面的父层,然后隐藏ModalPopupXtender控件和面板控件

这是线


我从asp.net的Yu Yongqing()那里得到了一份指南,建议我在iframe页面上创建一个js方法,调用iframe页面的父层,然后隐藏ModalPoppeXtender控件和面板控件

这是线

<asp:TextBox ID="inputid" runat="server" Font-Size="14px" ></asp:TextBox>  

<asp:Button ID="Button3" runat="server" Text="Uncheck"  OnClick="btnCheck_Click"  />  
  protected void btnCheck_Click(object sender,EventArgs e)
        {

            string uncheck = inputid.Text;                                                                        

            bool supervisor = Cls.GetUncheckSupervisor(uncheck);



            if (supervisor==true)
            {
                this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", "window.close()",

.true);

            }
            else
            {


                Show("Wrong ID!");

            }