ASP.NET(C#)不提示直接关闭当前页面
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>");
}
{
//关闭按钮
//关闭页面--要弹出提示(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>");
}