asp.net实现关闭当前网页功能
asp.net实现关闭当前网页功能:
Response.Write("<script>window.close();</script>");// 会弹出询问是否关闭
Response.Write("<script>window.opener=null;window.close();</script>");// 不会弹出询问
或者:
protected void Button1_Click(object sender, EventArgs e)
{
//关闭按钮
//关闭页面--要弹出提示(IE6及以下不弹出提示)
ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>window.opener=null;window.close();</script>");
//不弹出提示直接关闭页面
ClientScript.RegisterStartupScript(Page.GetType(), "", "<script language=javascript>window.opener=null;window.open('','_self');window.close();</script>");
}