2013-03-21 81 views
0

我目前有:如何打開iframe中的重定向頁面作爲ASP.NET中父窗口中的新選項卡打開?

 String url = "../CustomerSettings/CustomerConfiguration.aspx?CustomerID=" + sqlCommand.Parameters["@ReturnCustomerID"].Value.ToString(); 

     this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myUniqueKey", "self.parent.location='"+url+"';", true); 

這個偉大工程的父頁面重定向,但我需要它來打開一個新的標籤。有什麼建議麼?

回答

0

像這樣的東西應該工作:

this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myUniqueKey", "window.open(" + url + ",'_blank');", true); 
+0

感謝您的快速reply..i試過,但沒有窗口打開了......記住我想打開父window..i標籤相信如果這是行得通的,它只會在iframe – w1ck3d64 2013-03-21 18:03:25

+1

窗口中打開.open經常被彈出窗口攔截器攔截。如果window.open不是由直接用戶輸入(例如單擊按鈕)啓動的,則會導致許多用戶出現問題。 – QFDev 2013-03-21 18:08:19

+1

對您有幫助嗎? http://stackoverflow.com/questions/1037839/how-to-force-link-from-iframe-to-be-opened-in-the-parent-window這表明應用來父頁面強制iframe內的所有鏈接在父頁面內打開。 – QFDev 2013-03-21 18:10:04

相關問題