![](/img/trans.png)
[英]How do I redirect to another web page from an ASP.NET Controller using JavaScript?
[英]Redirect from asp.net page to another using javascript function
我知道如果我想从asp.net页面重定向到代码后面的代码,我需要写 -
Response.Redirect("SomePage.aspx");
我的问题是,是否可以在javascript函数中执行相同的操作,如果是这样的话怎么样?
谢谢!
这应该做:
window.location = "SomePage.aspx";
要么
window.location.href="SomePage.aspx";
要么
window.location.assign("SomePage.aspx");
你可以试试这个
window.location.href = 'page.aspx';
我不知道是否是最好的方式
试试这个....
ScriptManager.RegisterStartupScript(this, this.GetType(), "onclick", "javascript:window.open( 'SomePage.aspx','_blank','height=600px,width=600px,scrollbars=1');", true);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.