简体   繁体   English

注销时关闭子弹出页面/关闭父页面

[英]close child popup pages on logout / closing the parent page

How to close all child windows on closing/logout of Main page/window .I am using c# for button click event. 如何在关闭/退出主页/窗口时关闭所有子窗口。我正在使用c#进行按钮单击事件。 On Logout button click event of main page I need to close all other child popups. 在主页上的注销按钮单击事件上,我需要关闭所有其他子弹出窗口。 My popup page name is dmssview.aspx and logout button click code behind below 我的弹出页面名称是dmssview.aspx,注销按钮单击下面的代码

protected void BLogOut_Click(object sender, EventArgs e)
{
  Session["UserAuthentication"] = null;
  Response.Redirect("~/SM_Login.aspx");
}

Please help me for closing popup pages 请帮助我关闭弹出页面

write the code in the log out button's click event 将代码写入注销按钮的click事件中

private void btnExit_Click(object sender, EventArgs e)
     {        
            for (int i = Application.OpenForms.Count-1 ; i >= 0; i--)
            {
                if (Application.OpenForms[i].Name != "Menu")
                    Application.OpenForms[i].Close();
            }



     }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM