Client Close Problem

3 posts, 0 answers
  1. Hakan
    Hakan avatar
    12 posts
    Member since:
    Jul 2010

    Posted 31 Jul 2010 Link to this post

    I want to close window.When I click a button.
    But javascript code gives an error window value null.oWindow value always null.This code runs on usercontrol
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
            function GetRadWindow() {
                    var oWindow = null;
                    if (window.radWindow) oWindow = window.radWindow;
                    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                    alert(oWindow);
                    oWindow.close();
                }
      
       
            </script>
        </telerik:RadScriptBlock>
    <telerik:RadWindow ID="mdlPopup"  runat="server" Title="Bilgi Ekranı" Skin="Windows7"
        Width="440px" Height="150px" Modal="true" Top="50%" Left="50%" Behaviors="Close,Move"
        EnableShadow="false" VisibleStatusbar="False" >
        <ContentTemplate>
            <div style="padding: 10px">
                <table cellpadding="3" style="width: 100%">
                    <tr>
                        <td valign="middle" style=" padding-left:20px">
                            <asp:Image ID="imgWarning" runat="server" ImageAlign="AbsMiddle" />
                        </td>
                        <td style=" height:60px">
                            <asp:Label ID="lblMessage" Font-Bold="false" runat="server" ForeColor="#1E395B"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <input id="Button1" type="button" onclick="javascript:GetRadWindow();" value="button" />
                             
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </telerik:RadWindow>
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 03 Aug 2010 Link to this post

    Hello Hakan,

    The GetRadWindow() function is used only when RadWindow displays a content page - i.e. the content page is displayed in an IFRAME. In your case, you are using RadWindow as a content template, i.e. the content is on the same page and that is why oWindow will always return null. If you want to close the window in such case, you only need to get a reference to it by using $find() and then call its close() method.



    Best wishes,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Hakan
    Hakan avatar
    12 posts
    Member since:
    Jul 2010

    Posted 05 Aug 2010 Link to this post

    Thank you problem solved
Back to Top