views:

30

answers:

1

I have UserControl and within that control i have asp:ListView. Inside the ListView i have a asp:LinkButton. When i click on the LinkButton the control raises full postback, no matter if the UserControl is inside UpdatePanel or is not.

UserControl:

<asp:ListView ID="lvImages" runat="server" OnItemCommand="lvImages_ItemCommand">
     <ItemTemplate>
        <div>
               <asp:Image runat="server" ID="imgImageThumb" ImageUrl='<%#Eval("Image") %>' GenerateEmptyAlternateText="true" />
               <asp:LinkButton runat="server" ID="lbtnImageAdd" CommandName="Add" CommandArgument='<%#Container.DisplayIndex %>'
                                    CausesValidation="false" Text="Add" />  
        </div>
     <ItemTemplate>
</asp:ListView>

Page:

<asp:UpdatePanel ID="up" runat="server">
    <ContentTemplate>
           <cuc:UserControl ID="cucUserControl" runat=server/>
    </ContentTemplate>
</asp:UpdatePanel>
A: 

You need to set the properties to let the update panel know what to trigger off of. Try setting ChildrenAsTrigger=true.

bechbd
I have tried that before, but the control stil raised full postback.