RadWindow disappear on partial postback

4 posts, 1 answers
  1. Lakpa
    Lakpa avatar
    13 posts
    Member since:
    Dec 2013

    Posted 20 Jan 2014 Link to this post

    Hi,
       I am having a problem with RadWindow disappearing after partial postback.

    1. I use a RadScheduler with AdvanceForm Mode and on AdvanceInsertTemplate I have my "USERCONTROL". This RadScheduler is linked with RadAjaxManager.
    2. That "USERCONTROL" has a button that pop up RadWindow and that RadWindows has a "SEARCH BUTTON" to display a list in grid.
    3. When I click the  "SEARCH BUTTON" , the radwindow disappear.
    4. RadScriptManagerProxy is linked with the "SEARCH BUTTON".

    I can't figure out why its not working.

    In Asp.net if the controls were kept inside an update panel, then the popup wasn't suppose to disappear after partial postback.

    Thanking you
    Lakpa Sherpa
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 20 Jan 2014 Link to this post

    Hi Lakpa,

    Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadScheduler ID="RadScheduler1" runat="server" DataSourceID="SqlDataSource1"
        DataKeyField="ID" DataEndField="End" DataStartField="Start" DataSubjectField="Subject"
        DayStartTime="08:30:00">
        <AdvancedForm Modal="true" EnableTimeZonesEditing="true" />
        <AdvancedInsertTemplate>
            <div class="rsAdvancedEdit rsAdvancedModal" style="position: relative">
                <div class="rsModalBgTopLeft">
                </div>
                <div class="rsModalBgTopRight">
                </div>
                <div class="rsModalBgBottomLeft">
                </div>
                <div class="rsModalBgBottomRight">
                </div>
                <div class="rsAdvTitle">
                    <h1 class="rsAdvInnerTitle">
                        <%# Container.Appointment.Owner.Localization.AdvancedNewAppointment %></h1>
                    <asp:LinkButton runat="server" ID="AdvancedEditCloseButton" CssClass="rsAdvEditClose"
                        CommandName="Cancel" CausesValidation="false" ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
    <%# Container.Appointment.Owner.Localization.AdvancedClose%>
                    </asp:LinkButton>
                </div>
                <div class="rsAdvContentWrapper">
                    <telerik:RadTextBox ID="SubjectTextBox" runat="server" Text='<%# Bind("Subject") %>'
                        Label='<%# Container.Appointment.Owner.Localization.AdvancedSubject%>'>
                    </telerik:RadTextBox>
                    <p>
                        <uc1:WebUserControl ID="WebUserControl1" runat="server" />
                    </p>
                    <asp:Panel runat="server" ID="ButtonsPanel" CssClass="rsAdvancedSubmitArea">
                        <div class="rsAdvButtonWrapper">
                            <asp:LinkButton CommandName="Update" runat="server" ID="UpdateButton" CssClass="rsAdvEditSave">
    <span><%# Container.Appointment.Owner.Localization.Save%></span>
                            </asp:LinkButton>
                            <asp:LinkButton runat="server" ID="CancelButton" CssClass="rsAdvEditCancel" CommandName="Cancel"
                                CausesValidation="false">
    <span><%# Container.Appointment.Owner.Localization.Cancel%></span>
                            </asp:LinkButton>
                        </div>
                    </asp:Panel>
                </div>
            </div>
        </AdvancedInsertTemplate>
        <AdvancedEditTemplate>
            <asp:Label ID="label1" runat="server" Text="demo">
            </asp:Label>
        </AdvancedEditTemplate>
    </telerik:RadScheduler>

    UserControl :
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadWindow1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadButton2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadButton2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Open" OnClick="RadButton1_Click">
    </telerik:RadButton>
    <telerik:RadWindow ID="RadWindow1" runat="server">
        <ContentTemplate>
            <telerik:RadButton ID="RadButton2" runat="server" Text="Search Button" OnClick="RadButton2_Click1">
            </telerik:RadButton>
            <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="true"
                Visible="false">
                <MasterTableView>
                </MasterTableView>
            </telerik:RadGrid>
        </ContentTemplate>
    </telerik:RadWindow>

    UserControl Pgae C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        RadWindow1.VisibleOnPageLoad = true;
    }
    protected void RadButton2_Click1(object sender, EventArgs e)
    {
        RadGrid1.Visible = true;
    }

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 21 Jan 2014 Link to this post

    Hello Lakoa,

    I am copying here my answer from your support ticket on the matter. I am not attaching the code samples because you may not want them public. If you like you can post the logic, or I could attach the same archives from the ticket.

    This scenario is quite complex because controls are added during partial postbacks and thus AJAX settings related to them need to be plugged in the page lifecycle after the controls are available.

    What I can offer is choosing one of the following options that seem to work fine on my end:
    - create AJAX settings programmatically in the FormCreated event of the Scheduler
    - OR use standard asp:UpdatePanels because they need not be plugged in the page lifecycle dynamically like our settings need to be.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  5. Lakpa
    Lakpa avatar
    13 posts
    Member since:
    Dec 2013

    Posted 21 Jan 2014 Link to this post

    Thank you for your support.
    Its working fine now.
Back to Top