updatepanel.update issue

zoftdown

New Member
I have two nested updatepanels I update the panels from the source code but nothing takes effect. the code is following\[code\]<div style="display:block; clear: left;" runat="server" id="DivLike"> <asp:UpdatePanel ID="UpdatePanelLike" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div style="position: relative;"> <div style="position: absolute; top: 0px; left: 0px;"> <asp:LinkButton ID="LinkButtonLike" runat="server" CommandName='<%#Eval("Like_Command") %>' Font-Size="XX-Small" OnCommand="LinkButton2_Command" Text='<%#Eval("Like_Command")%>'></asp:LinkButton> </div> <div class="popupstyle" style="position:absolute; top:0px; left:0px; display:none;" id="DivChapters" runat="server"> <asp:UpdatePanel ID="UpdatePanelLinkActivity" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div>Select Chapter: <asp:DropDownList ID="DropDownListChapters" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownListChapters_SelectedIndexChanged"></asp:DropDownList> </div> <div>Select Topic: <asp:DropDownList ID="DropDownListTopics" runat="server"></asp:DropDownList> </div> <div> <asp:LinkButton ID="LinkButtonAddLink" runat="server" OnCommand="LinkButtonAddLink_Command" Text="Add" CssClass="UtilityClass"></asp:LinkButton> </div> <asp:UpdateProgress ID="UpdateProgressLinkActivity" runat="server" AssociatedUpdatePanelID="UpdatePanelLinkActivity" DynamicLayout="True"> <ProgressTemplate> <div style=" position:absolute; top:50%; left:50%; background-color:white;" id="divLoading"> <img src="http://stackoverflow.com/questions/12656314/Images/loading25.gif" alt="Loading..." style="" /> </div> </ProgressTemplate> </asp:UpdateProgress> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="LinkButtonAddLink" EventName="Command" /> </Triggers> </asp:UpdatePanel> </div> </div> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="LinkButtonLike" EventName="Command" /> </Triggers> </asp:UpdatePanel></div>\[/code\]Code Behind below updates the panels but none of the panel is updated. though when I analyze it with debugger every thing is assigned perfectly. \[code\] protected void DropDownListChapters_SelectedIndexChanged(object sender, EventArgs e ) { DropDownList DDL = (DropDownList)sender; DropDownListTopics.DataSource = ChapterDataAccess.GetUserTopics(Convert.ToInt32(DDL.SelectedItem.Value), new Guid(Membership.GetUser().ProviderUserKey.ToString())); DropDownListTopics.DataTextField = "Name"; DropDownListTopics.DataValueField = "Id"; DropDownListTopics.DataBind(); ListItem item=new ListItem ("topics","value" ); DropDownListTopics.Items.Add(item); UpdatePanel thepanel= (UpdatePanel)DDL.Parent.Parent; UpdatePanel theparentpanel=(UpdatePanel)DDL.Parent.Parent.Parent.Parent.Parent ; theparentpanel.Update(); thepanel.Update();}\[/code\]
 
Back
Top