views:

698

answers:

1

I am registering the script on my page load event for the thickbox page to open. But some time only the gray background appears and not the thickbox page. Let me know if I am missing anything. Below is the code for registering the thickbox. Any help would be greatly appreciated.

 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())

I am new to the forum..let me know if any similar thread has the solution?

Thanks Gabi

A: 
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.
         }
Gabriel Susai