RadWindow is closed when is used inside an usercontrol

809 Views Asked by At

I have 2 user control. 1 User control inside other user control

User Control 2

   <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Uc2.ascx.cs" Inherits="Wrapsons.WebApp.UserControls.UcSeason" %>
     <asp:Button ID="BtnTest" runat="server" OnClick="BtnTest_OnClick" Text="Test"/>

User Control 1

 <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Uc1.ascx.cs" Inherits="Wrapsons.WebApp.UserControls.UcSeason" %>
<asp:UpdatePanel runat="server">
           <ContentTemplate>
    <telerik:RadWindow ID="RadWindow" runat="server">
        <ContentTemplate>
            <uc1:Uc2 ID="Uc2" runat="server" />  
        </ContentTemplate>
        </telerik:RadWindow>
    </ContentTemplate>
</asp:UpdatePanel>

In Test.aspx Uc1 is used

When I click on Test Button, RadWindow is closed.

Is there any way to avoid the postback?

Thank you in advance!

1

There are 1 best solutions below

0
On

Here is how to use AJAX properly with the ContentTemplate: http://www.telerik.com/help/aspnet-ajax/window-ajaxifying.html

and here is your snippet, modified:

        <telerik:RadWindow ID="RadWindow" runat="server">
            <ContentTemplate>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <uc1:uc2 id="Uc2" runat="server" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </ContentTemplate>
        </telerik:RadWindow>

Also, go through this one if you need to open/close the window from your server code: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-opening-from-server.html