views:

20

answers:

1

My issues here is that this does not compile. I get "A control with ID 'LinkButtonRemove' could not be found for the trigger in UpdatePanel 'UpdatePanelFiles'."

What I am trying to do is have two buttons in the item template. One that updates just the ITEM and one that updates the entire DataList. "LinkButtonRemove" is what I want to update the entire datalist. Any ideas on why this isnt working? Or how to do what I want to do?


THE SHORT VERSION:
UPDATEPANEL1
-DATALIST
--ITEM
---UPDATEPANEL2
----CONTROLS

I want one control to update the item updatepanel only and the other to update the entire datalist.


       <asp:UpdatePanel ID="UpdatePanelFiles" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="LinkButtonRemove" />
            </Triggers>
            <ContentTemplate>
                <asp:DataList ID="DataListFiles" class="MediaManagerDataList" runat="server" ItemStyle-BackColor="#ffffff" AlternatingItemStyle-BackColor="#E7F4FF" OnItemCommand="DataListFiles_ItemCommand">
                    <ItemTemplate>
                        <asp:UpdatePanel ID="UpdatePanelItem" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <div class="item">
                                    <asp:LinkButton ID="LinkButtonRemove" CommandName="remove" runat="server">Remove</asp:LinkButton>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </ItemTemplate>
                </asp:DataList>
            </ContentTemplate>
        </asp:UpdatePanel>
+1  A: 

The updatepanel can't see the button, but it can see the list. You can skip the trigger part and just call updatepanel.update() in your codebehind when you handle the click event.

MCain
Didn't know you could do that. It works, thanks! I'll mark as answer when I'm allowed to.
Blankasaurus