checkbox in the panel control under control of one page

西门胜涝
2023-12-01

If you have one page has the updatepanel inside and want to use checkbox with child update panel in the child control. You will get the loading screen. What you need to stop the forever loading, you should tell the parent page the child update panel is done. Example:


Parent page:

<asp:content id="contentManageLibrary" contentplaceholderid="ContentPlaceHolder1"
    runat="server">
    <div id="manage_librarytab">
        <asp:UpdatePanel ID="upManageLibrary" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <ajaxToolkit:TabContainer ID="tabNavigation" runat="server" Width="100%" ActiveTabIndex="0"
                    AutoPostBack="False" OnActiveTabChanged="tabNavigation_ActiveTabChanged" OnClientActiveTabChanged="loadActiveTabChanged">
                    <ajaxToolkit:TabPanel ID="tpCoursePackages" runat="server" ToolTip="Click here to view/edit Manage Library Settings.">
                        <HeaderTemplate>
                            <asp:Image ID="imgCourse" runat="server" ImageUrl="~/Resource/Images/1.png" />
                            Course Packages
                        </HeaderTemplate>
                        <ContentTemplate>
                            <div class="gridContainer">
                                <uc2:CoursePackages ID="uc Packages" runat="server" />
                            </div>
                        </ContentTemplate>
                    </ajaxToolkit:TabPanel>
              
            </ContentTemplate>
        </asp:UpdatePanel>
        <ajaxToolkit:UpdatePanelAnimationExtender ID="upae" BehaviorID="animation" runat="server"
            TargetControlID="upManageLibrary">
            <Animations>
                    <OnUpdating>
                        <Parallel duration="0">
                            <%-- place the update progress div over the gridview control --%>
                            <ScriptAction Script="onUpdating();" />  
                         </Parallel>
                    </OnUpdating>
                    <OnUpdated>
                        <Parallel duration="0">
                            <%--find the update progress div and place it over the gridview control--%>
                            <ScriptAction Script="onUpdated();" />
                        </Parallel>
                    </OnUpdated>
            </Animations>
        </ajaxToolkit:UpdatePanelAnimationExtender>
        <div id="updateProgressDiv" class="updateProgress" style="display: none">
            <div align="center" style="margin-top: 23px;" class="updateProgressImg">
                <span class="updateProgressMessage">Loading ...</span>
            </div>
        </div>
    </div>
</asp:content>

In the Child Control:

<asp:Panel ID="pnlAddQuestion" runat="server" Style="display: none;" >
    <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional">
        <ContentTemplate>  

 <asp:CheckBox ID="ckbDeclaimer" runat="server" OnCheckedChanged="ckbDeclaimer_CheckedChanged"
                    AutoPostBack="true" />

</ContentTemplate>


In the cs


 protected void ckbDeclaimer_CheckedChanged(object sender, EventArgs e)
        {
            ckbDeclaimerEvent();

   //To avoid the Modal popup closing on server events and hide the loading and tell the parent, the child control has finished the update

System.Web.UI.UpdatePanel upManageLibrary = (System.Web.UI.UpdatePanel)this.Page.FindControl("ctl00$ContentPlaceHolder1$upManageLibrary");
            if (upManageLibrary != null)
            {
                upManageLibrary.Update();
            }


        }


 类似资料:

相关阅读

相关文章

相关问答