2009-08-19 67 views
0

我在我的頁面加載事件中註冊腳本,以便打開thickbox頁面。但有些時候只會出現灰色背景,而不是厚紙頁面。讓我知道我是否缺少任何東西。以下是註冊thickbox的代碼。任何幫助將不勝感激。在IE瀏覽器的頁面加載時,Thickbox頁面無法加載(始終如一)

Dim sb As New StringBuilder() 
      sb.AppendLine("<script type=""text/javascript"">") 
      sb.AppendLine("jQuery(document).ready(function($)") 
      sb.AppendLine("{") 
      sb.AppendLine("tb_show(null, ""Thickbox.aspx?TB_iframe=true&height=500&width=500&modal=true"", null)") 
      sb.AppendLine("});") 
      sb.AppendLine("</script>") 
      Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "RegisterWidgetScript", sb.ToString()) 

我是新來的forum..let我知道如果任何類似的線程有解決方案嗎?

由於 加比

+0

何時只有所述灰色背景上,是它看似隨機的或者是有一個模式?另外,你是否也有tb_show()函數的代碼? – 2009-08-19 15:38:15

+0

這是不是有任何理由不只是在aspx方的腳本塊?代碼看起來是正確的,但如果可能的話,我會嘗試將它放在頁面的底部,而不用ASP的幫助。此外,請在週期,預渲染或渲染事件的後期嘗試。 – Jab 2009-08-19 18:27:00

+0

嗨拉斯, 它發生隨機,這也是在IE瀏覽器。 我不知道如何添加評論中的代碼..它有內容長度的限制。無論如何,我正在使用3.1厚盒版。 「Thickbox 3.1 - 一個盒子統治他們。」 感謝您的意見。 – 2009-08-24 16:14:06

回答

0
I have fixed this issue. 

In IE the imgLoader variable is null since I am calling the tb_show from the asp.net code behind. So I added the below code to check if the object is null and then initialize and assign the image url. 

//Check if the image loader is null, this occurs when we call the tb_show method from the code behind 
    if (typeof imgLoader === 'undefined') 
      { 
       imgLoader = new Image();// preload image 
         imgLoader.src = tb_pathToImage;//Animated loader gif image. 
      }