2010-11-08 205 views
1

當用戶點擊linkBut​​ton時,需要打開新窗口才能顯示一些數據。 我試試這個:如何在dotnetnuke中打開aspx頁面如彈出窗口

string url = "~/SomePage.aspx"; 
       string cmd = "window.open('" + url + "', '_blank', 'height=500,width=800,status=yes,toolbar=no,menubar=no,location=yes,scrollbars=yes,resizable=no,titlebar=no');"; 
       ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", cmd, true); 

但它不工作。我甚至無法手動導航到此頁面。打開新窗口工作,但它在新窗口中打開相同的頁面。 那麼,如何在這個新窗口中顯示來自SomePage.aspx的內容呢?

+0

在dnn 6 使用urlutils.popupurl ..查看登錄彈出如何打開 – 2011-12-06 09:35:52

回答

2

如果您不能手動導航到該頁面,那麼你使用的是錯誤的URL。通過Admin |查看頁面Pages功能可以查看它正在使用的網址。在代碼中,最好使用NavigateURL方法來獲取頁面的正確URL。

0

試試這個..

string url = "./SomePage.aspx"; 
ScriptManager.RegisterClientScriptBlock (Page, Page.GetType(), "openPopup", "window.open('" + url + "','_blank','height=500,width=800,status=yes,toolbar=no,menubar=no,location=yes,scrollbars=yes,resizable=no,titlebar=no');", True) 
+0

不,這是行不通的:(我總是得到像這樣的URL http:// localhost/dnn/bla/blas/view_bla/tabid/121/language/zh-CN/SomePage.aspx在新窗口中:( – 1110 2010-11-08 11:01:48

+0

)你說你甚至無法手動導航到頁面?Somepage.aspx是否包含在你的網站的根目錄中? – 2010-11-08 11:08:09

+0

不,甚至沒有手動。一個dotnetnuke模塊,我添加了SomePage.aspx,但是我無法導航到其他已存在的頁面: – 1110 2010-11-08 11:19:06

0

我知道,這是從精確解有點不同,但你有沒有嘗試過這樣的事情?

<a href="http://www.microsoft.com" target="_blank">Microsoft</a>

0

如果您添加了一個aspx頁面到一個模塊中的文件路徑應該是

/desktopmodules/modulefolder/something.aspx

0

在我創建的頁面末尾,我要像DNN頁面並打開它像在單獨的窗口中從dnn編輯頁面。

相關問題