This is a migrated thread and some comments may be shown as answers.

Unable to set value of the property 'OnClientClose': object is null or undefined

2 Answers 126 Views
Window
This is a migrated thread and some comments may be shown as answers.
Tinoy Malayil
Top achievements
Rank 2
Tinoy Malayil asked on 14 Oct 2011, 06:18 AM
Hi moderator/admin,

When I click to open the radwindow in Internet Explorer 9 browser I got the following error:
Message: Unable to set value of the property 'OnClientClose': object is null or undefined
Line: 67
Char: 3
Code: 0

My js file is written as follows to open radwindow:

<code>
function openradwindow(windowname,TitleBarBackgroundColor,navigateurl,width,height,titleimage,titlename)
{
    try
    {
    
    var oWindow =window.radopen(navigateurl, windowname);
//    var oContentFrame = oWindow.get_ContentFrame();     
    
    oWindow.SetTitle(titlename);
    var divWin = document.getElementById("RadWindowWrapper_ctl00_radwindow");
    divWin.style.backgroundColor = TitleBarBackgroundColor;
    //divWin.style.zIndex=3049;
    //divWin.style.position=relative;
     divWin.style.titlename=titlename;
    var i;
    
    for(i=0;i<10;i++)
    {
        if(document.styleSheets[i]!=null)
        {
            
            var strStyleSheetName = document.styleSheets[i].href;
            if(strStyleSheetName != null)
            {
            //added for radwindow icon image and background color of icon image
            if( strStyleSheetName.indexOf( "RadControls/Window.RadControls.css" ) != -1 )
            {
                try
                {
                    //document.styleSheets[i].rules[0].style.backgroundImage = "url("+titleimage+")";
                    
                    document.styleSheets[i].rules[0].style.backgroundColor =TitleBarBackgroundColor;
                }
                catch(err)
                {
               
                    //document.styleSheets[i].cssRules[0].style.backgroundImage = "url("+titleimage+")";
                   
                    document.styleSheets[i].cssRules[0].style.backgroundColor = TitleBarBackgroundColor;
                   
                }
            }
            }
        }
    }
    oWindow.SetWidth(width);
    oWindow.SetHeight(height);
    oWindow.show();
  }
  catch(err)
  {
  }  
 
  oWindow.OnClientClose = function()   
  {   
    oWindow.SetUrl("about:blank");
    oWindow.remove_close(OnClientClose);  
  }  
   
 }
</code>

The above javascript function is working fine in all other browsers.
How to open my radwindow in IE 9? Please reply.

Regards,
Tinoy Malayil

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Oct 2011, 06:49 AM
Hello Tinoy,

I am not quite sure about the version you are using. I suppose this problem is related to the version you are using.  from Q1 2011 telerik officially support IE9 and if you upgrade to it or a later version, everything will work fine.

You can check this forum thread for more information.

Thanks,
Shinu.
0
Tinoy Malayil
Top achievements
Rank 2
answered on 14 Oct 2011, 11:05 AM
Hi Shinu,
I am using Telerik ASP.Net Ajax Version 2008. The rad window is not opening in IE 9.It works if we add meta tag to set compatibility to IE8.
Regards,
Tinoy
Tags
Window
Asked by
Tinoy Malayil
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Tinoy Malayil
Top achievements
Rank 2
Share this question
or