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

closing a window containing a form with a RadAjaxPanel

5 Answers 37 Views
Window
This is a migrated thread and some comments may be shown as answers.
Marcelo
Top achievements
Rank 1
Marcelo asked on 19 Sep 2012, 11:58 AM
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


5 Answers, 1 is accepted

Sort by
0
rdmptn
Top achievements
Rank 1
answered on 19 Sep 2012, 12:33 PM
0
Marcelo
Top achievements
Rank 1
answered on 19 Sep 2012, 02:36 PM
can you be more specific.? please. i'm still having the issue
0
rdmptn
Top achievements
Rank 1
answered on 19 Sep 2012, 03:14 PM
Inject the script properly for use in a partial postback. This is what the article explains. The method is ScriptManager.RegisterStartupScript(). Or just use the ResponseScripts collection of the RadAjaxPanel, it has the same effect.
0
Marcelo
Top achievements
Rank 1
answered on 19 Sep 2012, 03:57 PM
I put a "debugger;" in the script and simply nothing runs on the client side
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
Window
Asked by
Marcelo
Top achievements
Rank 1
Answers by
rdmptn
Top achievements
Rank 1
Marcelo
Top achievements
Rank 1
Share this question
or