C# IE浏览器页面加载时Thickbox页面未加载(一致)

C# IE浏览器页面加载时Thickbox页面未加载(一致),c#,asp.net,jquery,thickbox,C#,Asp.net,Jquery,Thickbox,我正在我的页面加载事件中注册脚本,以便打开thickbox页面。但有时只会出现灰色背景,而不会出现thickbox页面。如果我遗漏了什么,请告诉我。下面是注册thickbox的代码。任何帮助都将不胜感激 Dim sb As New StringBuilder() sb.AppendLine("<script type=""text/javascript"">") sb.AppendLine("jQuery(document).read

我正在我的页面加载事件中注册脚本,以便打开thickbox页面。但有时只会出现灰色背景,而不会出现thickbox页面。如果我遗漏了什么,请告诉我。下面是注册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())
Dim sb作为新的StringBuilder()
某人加上一行(“”)
sb.AppendLine(“jQuery(document).ready(function($)”)
某人加上一行(“{”)
sb.AppendLine(“tb_show(null”,“Thickbox.aspx?tb_iframe=true&height=500&width=500&modal=true”,“null”)
sb.附录(“};”)
某人加上一行(“”)
Page.ClientScript.RegisterClientScriptBlock(Me.GetType(),“RegisterWidgetScript”,sb.ToString())
我是新来的论坛…让我知道,如果任何类似的线程有解决方案

谢谢
Gabi

什么时候只有灰色背景出现,它看起来是随机的还是有规律的?另外,您是否也有tb_show()函数的代码?是否有任何原因不只是在aspx端的脚本块中?代码看起来是正确的,但如果可能的话,我会尝试在没有ASP帮助的情况下将其放在页面底部。另外,请稍后在循环中尝试预渲染或渲染事件。嗨,Russ,它是随机发生的,这也在IE浏览器中。我不知道如何在注释中添加代码。它有内容长度限制。无论如何,我使用的是3.1 thickbox版本。“Thickbox 3.1-一个框来管理所有这些内容。”感谢您的评论。
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.
            }