GetRadWindow().close() doesn't work

3 posts, 0 answers
  1. Uyen
    Uyen avatar
    1 posts
    Member since:
    Jun 2014

    Posted 11 Jul 2014 Link to this post

    Hi all,

    I call a RadWindow which contain an user control (frmEditSteps)

    Parent Page:
    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
              ReloadOnShow="true" runat="server" EnableShadow="true">
                <telerik:RadWindow ID="RadWindow1" runat="server" Skin="Telerik" Behaviors="Close, Move" Modal="true" AutoSize="true" >
                        <uc1:frmEditSteps runat="server" id="frmEditSteps" />  //My User Control

    After that, I close the RadWindow1 by clicking a button in user control. But it doesn't work.
    User control frmEditSteps
    <button title="Submit" id="close" onclick="ClosePopcmn(); return false;">Submit</button>
    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            //else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;        
            return oWindow;

        function ClosePopcmn() {        
            var oWnd = GetRadWindow();
            oWindow.close(); --------------------------> It doesn't work??????      
    I don't know why.
    But when I run Website on Internet Explorer, it generate an error at oWindow.close()
    That error is: 0x800a138f - JavaScript runtime error: Unable to get property 'close' of undefined or null reference

    Please help me.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 13 Jul 2014 in reply to Uyen Link to this post

    Hi Uyen,

    Please have a look into this online demo which works as expected for me. Please provide your code if it doesn't help.

  3. DevCraft R3 2016 release webinar banner
  4. Marin Bratanov
    Marin Bratanov avatar
    3567 posts

    Posted 14 Jul 2014 Link to this post

    Hi guys,

    When the ContentTemplate of the control is used, you can get a reference to it only through the $find() method MS AJAX offers. This is shown in the following demo:


    Marin Bratanov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top