![](/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.