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

closing a window containing a form with a RadAjaxPanel

1 Answer 54 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Marcelo
Top achievements
Rank 1
Marcelo asked on 19 Sep 2012, 04:01 PM
I have a form like this, and i show it with a radwindows.
  
<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">  </telerik:RadAjaxLoadingPanel>
     
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1">
            
                        <asp:Label CssClass="label" ID="lblSedes" Text="Sede:" runat="server" />
                       <telerik:RadComboBox ID="ddlSedes" AutoPostBack="true" AllowCustomText="true" Filter="Contains" runat="server">
                         </telerik:RadComboBox>
                        <asp:Label CssClass="label" Text="Personal:" ID="lblPersonal" runat="server" />
                        <telerik:RadComboBox ID="ddlPersonal" AllowCustomText="true" Filter="Contains" runat="server">
                        </telerik:RadComboBox>
                        <asp:Label CssClass="label" ID="lblFecha" runat="server" Text=" Fecha:" />
                      <telerik:RadDatePicker runat="server" ID="txtFecha">
                        </telerik:RadDatePicker>
                        
     <asp:Button ID="btnGuardar" CssClass="btnGuardar" runat="server" Text="Guardar" />
<script type="text/javascript">
    function GetRadWindow()     
        {     
            var oWindow = null;     
            if (window.radWindow)
                oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog     
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;//IE (and Moz as well)     
            return oWindow;               
        }     
       function cerrar()     
        {     
              GetRadWindow().Close();
                if (!arg)
                    {
                       parent.refreshGrid();
                    }
                    else
                    {
                       parent.refreshGrid("RebindAndNavigate");
                    }  
        }           
    </script>
   </telerik:RadAjaxPanel>

                  
                 
               And when i try to close it from code behind , the code don't works  
 
ClientScript.RegisterStartupScript(Me.GetType(), "Nombre",  " <script>cerrar();</script>" False)


if I try without the RadAjaxLoadingPanel works well.

help please. i need close this windows

1 Answer, 1 is accepted

Sort by
0
Marcelo
Top achievements
Rank 1
answered on 19 Sep 2012, 05:09 PM
Solved :

For inject java script write this
without tags just call the function javascript
 
RadAjaxPanel1.ResponseScripts.Add(script)
Tags
Ajax
Asked by
Marcelo
Top achievements
Rank 1
Answers by
Marcelo
Top achievements
Rank 1
Share this question
or