2017-02-13 75 views
1

打開彈出窗口後,我需要重新加載我的頁面。這裏頁面重新加載,但彈出窗口未打開。如何解決它。彈出窗口不在代碼後面打開

string url = "Popup.aspx"; 
string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');"; 
ClientScript.RegisterStartupScript(this.GetType(), "script", s, true); 
Response.Redirect("~/mysamepage.aspx", false); 

回答

1

有你在其追加到s串試圖在JavaScript中的刷新:

window.location.reload(false); 

// If you need to fetch the webpage from the web-server again (where the page 
//contents change dynamically) pass the argument as 'true' instead of 'false'. 

string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');window.location.reload(false);"; 

或嘗試:

window.opener.href('url').reload(true); 
+0

其不斷加載。不打開我的頁面 – Hisanth

+0

不打開彈出頁面,你有沒有禁用彈出窗口攔截器?你見過這個嗎? http://stackoverflow.com/questions/7599382/javascript-popup-window-and-reload –

相關問題