【问题标题】:Redirect from asp.net page to another using javascript function使用javascript函数从asp.net页面重定向到另一个页面
【发布时间】:2014-04-11 13:40:46
【问题描述】:

我知道如果我想在后面的代码中从 asp.net 页面重定向到花药,我需要编写-

Response.Redirect("SomePage.aspx");

我的问题是是否有可能在 javascript 函数中做同样的事情,如果可以的话怎么做?

谢谢!

【问题讨论】:

标签: javascript asp.net visual-studio-2010 response.redirect


【解决方案1】:

应该这样做:

window.location = "SomePage.aspx";

window.location.href="SomePage.aspx";

window.location.assign("SomePage.aspx");

【讨论】:

  • 旧帖子,但您如何在此添加 5 秒计时器?
【解决方案2】:

试试这个....

ScriptManager.RegisterStartupScript(this, this.GetType(), "onclick", "javascript:window.open( 'SomePage.aspx','_blank','height=600px,width=600px,scrollbars=1');", true);

【讨论】:

    【解决方案3】:

    你可以试试这个

    window.location.href = 'page.aspx';
    

    不知道是不是最好的办法

    【讨论】:

      猜你喜欢
      • 2011-08-22
      • 2014-09-01
      • 1970-01-01
      • 2015-08-14
      • 2016-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多