您现在的位置:首页 >> 软件开发 >> 内容

ASP.NET(C#)网页不提示直接关闭当前页面

时间:2023-12-12 23:13:44 点击:

  核心提示:根据不同版本IE,插入相应的代码即可。//关闭页面--要弹出提示(IE6及以下不弹出提示)ClientScript.RegisterStartupScript(Page.GetType(), '',...

根据不同版本IE,插入相应的代码即可。


//关闭页面--要弹出提示(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>");

作者:站长 来源:网络
相关文章
  • 没有相关文章
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 陈工笔记(www.dui580.com) © 2024 版权所有 All Rights Reserved.
  • 站长:陈工 微信号:chengongbiji QQ:24498854
  • Powered by 陈工