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

3 posts, 0 answers
  1. Tinoy Malayil
    Tinoy Malayil avatar
    11 posts
    Member since:
    Oct 2011

    Posted 14 Oct 2011 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Oct 2011 Link to this post

    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.
  3. Tinoy Malayil
    Tinoy Malayil avatar
    11 posts
    Member since:
    Oct 2011

    Posted 14 Oct 2011 Link to this post

    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
Back to Top