关闭框架网页(C#)

关闭框架页面

if(Page.IsPostBack)
{
}
else
{
this.btnZX.Attributes.Add("onclick","return confirm('您确定要注销系统吗?')");
this.btnClose.Attributes.Add("onclick","return confirm('您确定要退出系统吗?')");
}

private void btnZX_Click(object sender, System.EventArgs e)
{
Session.Remove("userAdmin");
Response.Write("<script language=javascript>window.parent.opener=null;window.parent.close();window.open('login.aspx');</script>");
}

private void btnClose_Click(object sender, System.EventArgs e)
{
Session.Remove("userAdmin");
Response.Write("<script language=javascript>window.parent.opener=null;window.parent.close();</script>");
}

自已再加两个:
退出:parent.parent.close();
转到其他页:Response.Write("<script>parent.location.href='index.aspx';</script>");

posted @ 2008-04-13 17:37  岩仔  阅读(143)  评论(0编辑  收藏  举报