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