我知道如果我想在ASP.NET页面的代码后端从一个页面重定向到另一个页面,我需要编写以下代码 -
Response.Redirect("SomePage.aspx");
我的问题是是否可能在JavaScript函数中执行同样的操作,如果可能,该如何实现?
谢谢!
我知道如果我想在ASP.NET页面的代码后端从一个页面重定向到另一个页面,我需要编写以下代码 -
Response.Redirect("SomePage.aspx");
我的问题是是否可能在JavaScript函数中执行同样的操作,如果可能,该如何实现?
谢谢!
window.location = "SomePage.aspx";
或者window.location.href="SomePage.aspx";
或者window.location.assign("SomePage.aspx");
ScriptManager.RegisterStartupScript(this, this.GetType(), "onclick", "javascript:window.open( 'SomePage.aspx','_blank','height=600px,width=600px,scrollbars=1');", true);
window.location.href = 'page.aspx';
我不知道这是否是最好的方法