2014-04-11 110 views
6

我知道,如果我想从asp.net页面重定向到花药在后面的代码,我需要为写重定向从asp.net页面到另一个使用JavaScript函数

Response.Redirect("SomePage.aspx"); 

我的问题是,如果是可能在javascript函数中做同样的事情,如果是这样的话?

谢谢!

+3

你做了什么研究呢? – Steve

+0

[跳转到使用JavaScript的新HTML页面]的可能的副本(http://stackoverflow.com/questions/442384/jumping-to-a-new-html-page-with-javascript) –

+0

http:// stackoverflow。 COM /问题/ 17874481 /重定向到一个-ASPX页面,使用JavaScript的 – Jay

回答

9

这应该这样做:

window.location = "SomePage.aspx"; 

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

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

你可以试试这个

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

我不知道,如果是最好的方式

0

试试这个....

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