开发者

ChildrenAsTriggers updatePanel not updating after Database Save

开发者 https://www.devze.com 2023-02-23 14:04 出处:网络
Greetings, I have a page that loads userEvents (Ie a wall post or profile update) in a webpart, this webpart is then registered onto a comment page, so then the person adds a wall comment we need to

Greetings,

I have a page that loads userEvents (Ie a wall post or profile update) in a webpart, this webpart is then registered onto a comment page, so then the person adds a wall comment we need to update the updatepanel that holds the web part. We cannot add the textbox and button to the webpart as it is a "reader" that issued on other parts of the site. So when the person adds a wall post it saves to the DB and loads a UserEvent into a different section to the DB, after this has happened to need to update the UpadatePanel holding the UserEvent Reader webpart. Ive read up and I think our solution is to use ChildrenAsTriggers.

Your help will be appreciated.

    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
                <div>
                      <asp:TextBox ID="txtAddWallPost" CssClass="multilinetextbox" MaxLength="200" runat="server"
                         TextMode="MultiLine"></asp:TextBox>
                          <br /> 
                        <div class="buttons">
 <asp:Button ID="btnButtonWallPost" runat="server" OnClick="btnButtonWallPost_Click">
                        </asp:Button>
                        </div>         
                        </div>

                <asp:UpdatePanel ID="UpdatePanel1" runat="server" EnableViewState="False" UpdateMode="Conditional" ChildrenAsTriggers="true" >
                <ContentTemplate>
                <uc1:UserEventsWebPart ID="UserEventsWe开发者_StackOverflow社区bPart1" runat="server"  />
                </ContentTemplate>
            </asp:UpdatePanel>
  </ContentTemplate>
</asp:UpdatePanel>

I hope I made this clear enough :P

Peter


If I understand you correctly, when a user hits the "btnButtonWallPost" button, you want the content within UpdatePanel1 to be updated?

If I do understand you correctly, then I'm a little confused by your set up. Why do you need the inner UpdatePanel? Everything should be updated when the button is clicked. That'll cause an update of the outer UpdatePanel which will in turn, update the inner UpdatePanel.

And yes, I believe setting ChildrenAsTriggers on the outer UpdatePanel should do the trick (although I believe it's set to true by default anyway).

0

精彩评论

暂无评论...
验证码 换一张
取 消