Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > RadWindow is closing with postback of button in RadWindow
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered RadWindow is closing with postback of button in RadWindow

Feed from this thread
  • Posted on Jun 6, 2011 (permalink)

    I'm not sure if this is by design or not. I've worked with RadWindows in the past, but usually using a RadWindow as a part of a RadWindowManager and with it loading up a separate page in the RadWindow. Here is the window setup:

    <telerik:RadWindow ID="wdwChange" runat="server" Modal="True" Behaviors="Close" Height="400px"
            Width="600px" Title="Request Revision">
            <ContentTemplate>
                <asp:Panel ID="pnlDirectoryInfo" runat="server">
                    Information goes here
                </asp:Panel>
                <telerik:RadButton ID="btnContinue" runat="server" Text="Continue">
                    <Icon PrimaryIconUrl="../Common/Images/goforward.png" />
                </telerik:RadButton>
                <telerik:RadButton ID="btnClose" runat="server" Text="Close">
                    <Icon PrimaryIconUrl="../Common/Images/close.gif" />
                </telerik:RadButton>
            </ContentTemplate>
        </telerik:RadWindow>
    I'm opening the RadWindow with the following javascript function:
    function OpenChange() {
                var oWnd = $find("<%= wdwChange.ClientID %>");
                oWnd.show();
                //Sys.Application.remove_load(OpenChange);
            }
    When the user clicks a LinkButton, the following is executed in code behind to open the window:
    ClientScript.RegisterStartupScript(Me.GetType, "Change", "Sys.Application.add_load(OpenChange);", True)

    The window opens okay, but as soon as I click one of the buttons in the window it closes. I really need it to stay open until I tell it to close since I'm going to take the user through several steps inside of the RadWindow.

    Thanks,
    Adam

  • Marin Bratanov Marin Bratanov admin's avatar

    Posted on Jun 7, 2011 (permalink)

    Hello Adam,

    You are using the ContentTemplate property, which means that the RadWIndow's contents are actually a part of the main page and not in an iframe (which is the case when the NavigateUrl property is used).

    There are several approaches you can take to avoid the disappearance of the RadWindow

    1. you can prevent the postbacks and work with JavaScript only (set the AutoPostBack property to false)
    2. you can inject a similar script to the one you are currently using to open the window after every postback from these buttons
    3. you can set the VisibleOnPageLoad property to true in the code-behind and the window will open after every postback, but you will need to reset it to false once you are done and that will require another trip to the server

    I hope my reply was helpful.



    Greetings,
    Marin
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

  • Posted on Jun 7, 2011 (permalink)

    Thanks, that makes perfect sense. I went with the VisibleOnPageLoad option.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Window > RadWindow is closing with postback of button in RadWindow