這可能是一個簡單的,但我還沒有找到任何簡單的解決方案。從代碼背後的文件Html彈出窗口
單擊按鈕在asp.net網頁按鈕上單擊事件html是從xml和xsl生成的。這個html被存儲爲字符串變量。例如,讓我們說
dim htmlString as string = "<div>This is my popup</div>"
從上面的html字符串我怎樣才能動態地在vb.net中創建html彈出窗口。我可以使用JavaScript創建前端彈出窗口,但還沒有找到任何解決辦法,通過隱藏文件的代碼在vb.net創建它
編輯:
這並不在IE瀏覽器,只適用於Firefox:
Dim popupScript As String = _
"<script language='javascript'> myPopup() </script>"
Dim mystring = "<html><body><div style=""color:black"">Name: Jame's</div></body></html>"
Page.ClientScript.RegisterStartupScript(Me.GetType(), "PopupScript", String.Format(popupScript))
我認爲這是ASP.NET,不是嗎?如何:'ClientScript.RegisterStartupScript(Me.GetType(),「newWindow」,String.Format(「」,url))' –
謝謝蒂姆,這是我需要,我在發佈問題後發現了這一點。只是想知道是否有任何不使用JavaScript的不同方式。 – Jemsworld