【问题标题】:How to open new tab before redirect如何在重定向之前打开新标签
【发布时间】:2016-12-26 07:04:15
【问题描述】:

在我的 ASP 项目中,我需要在将网站重定向到新地址之前打开一个新选项卡。

要打开一个新标签,我使用:

Context.Response.Write("<script> language='javascript'>window.open('google.com','_newtab');</script>");

在我添加重定向行之前,它就像一个魅力:

Response.Redirect(String.Format("~/CloseRequest.aspx?request_id={0}&returnURL={1}", RequestID, ReturnURL));

如果我离开这两行,页面只会将我重定向到而不打开新标签。

我该如何解决这个问题?

【问题讨论】:

    标签: javascript asp.net redirect


    【解决方案1】:
        Context.Response.Write("<script language='javascript'>window.open('google.com','_newtab');
    window.location.href='/CloseRequest.aspx?request_id="+RequestID+"&returnURL="+ReturnURL+"';</script>");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-17
      • 1970-01-01
      相关资源
      最近更新 更多