Problems with Repeater ItemCommand Event and UpdatePanel Triggers

Last post 04-03-2008 5:07 PM by dtabraha. 6 replies.

Sort Posts:

  • Problems with Repeater ItemCommand Event and UpdatePanel Triggers

    09-26-2006, 1:50 PM
    • Loading...
    • eCoGoblin
    • Joined on 02-24-2005, 12:39 PM
    • Posts 7

    Hello,
    I have an UpdatePanel with a big photo, and outside of the UpdatePanel i have a Repeater that shows some thumbnails.
    The code is something like this:
     

    <cc1:UpdatePanel ID="PanelFotoGrande" runat="server" Mode="Conditional">
    <ContentTemplate>
        <asp:Image ID="imgFotoGrande" runat="server" />
    </ContentTemplate>
    <Triggers>
        <cc1:ControlEventTrigger ControlID="Button1" EventName="Click" />
    </Triggers>
    </cc1:UpdatePanel>
    
    <asp:Repeater ID="rptMiniaturas"...>
        <ImageButton... /> (...Thumbnails...)
    </asp:Repeater>

     
     But it doesn't work. I'm sure that the problem is something about the Repeater control. If I try the same, but in place of a Repeater ItemCommand Event I use a Button Click Event, all works correctly.
    I mean something like this:

     

    <cc1:UpdatePanel ID="PanelFotoGrande" runat="server" Mode="Conditional">
    <ContentTemplate>
    
        <asp:Image ID="imgFotoGrande" runat="server" />
    
    </ContentTemplate>
    <Triggers>
        <cc1:ControlEventTrigger ControlID="Button1" EventName="Click" />
    </Triggers>
    </cc1:UpdatePanel>
    
    <asp:Button ID="btnFoto" runat="server" Text="btnFoto" />

     Can somebosy help me with that issue?
    Thanks!
     

     

  • Re: Problems with Repeater ItemCommand Event and UpdatePanel Triggers

    09-26-2006, 5:59 PM
    • Loading...
    • Garbin
    • Joined on 09-17-2004, 12:35 PM
    • Sassari, Italy
    • Posts 1,494
    • TrustedFriends-MVPs

    Hi,

    I think you've hit a bug with UpdatePanel and the ItemCommand event when Mode="Conditional".

    It is mentioned also in this article by Rick Strahl

    Alessandro Gallo | Blog | My book: ASP.NET AJAX In Action
  • Re: Problems with Repeater ItemCommand Event and UpdatePanel Triggers

    09-26-2006, 6:33 PM
    • Loading...
    • eCoGoblin
    • Joined on 02-24-2005, 12:39 PM
    • Posts 7

    Thanks Garbin,

    I read it. I have no idea how to make the behavior i want. I would like to refresh the big image, and some other things around de image, like nº of votes... I think in atlas for that purpose, because I would like to keep the thumbnails scroll in the same position when refreshing the image.

    Have any idea about to make that behavior? Sorry about my english ;-)

    Thanks.

  • Re: Problems with Repeater ItemCommand Event and UpdatePanel Triggers

    02-15-2007, 6:05 PM
    • Loading...
    • MrPredator
    • Joined on 02-01-2007, 7:45 PM
    • Posts 4
    I was looking at this post and your code and I see that you set your trigger to respond to a button's Click event inside the repeater.  The Triger will not find the button that way.  You may want to try to set the control to be the Repeater itself and the event the itemCommand.  i have not tried this but you may want to give it a shot.
  • Re: Problems with Repeater ItemCommand Event and UpdatePanel Triggers

    12-27-2007, 12:29 PM
    • Loading...
    • eCoGoblin
    • Joined on 02-24-2005, 12:39 PM
    • Posts 7

    Yes MrPredator, You are right. I have some mistakes in the code, but just mistakes when writting here. So, this is the real code:

    <cc1:UpdatePanel ID="PanelFotoGrande" runat="server" Mode="Conditional">
    <ContentTemplate>
        <asp:Image ID="imgFotoGrande" runat="server" />
    </ContentTemplate>
    <Triggers>
        <cc1:ControlEventTrigger ControlID="rptMiniaturas" EventName="ItemCommand" />
    </Triggers>
    </cc1:UpdatePanel>
    
    <asp:Repeater ID="rptMiniaturas"...>
        <ImageButton... /> (...Thumbnails...)
    </asp:Repeater>
    But this is the issue. It doesnt works correctly.
    Maybe with the new AJAX Toolkit it works fine? Somebody knows?
    Thanks to all.
  • Re: Problems with Repeater ItemCommand Event and UpdatePanel Triggers

    12-27-2007, 10:29 PM
  • Re: Problems with Repeater ItemCommand Event and UpdatePanel Triggers

    04-03-2008, 5:07 PM
    • Loading...
    • dtabraha
    • Joined on 01-26-2006, 1:19 PM
    • Posts 4

    The problem is probably with rebinding your repeater on the postbacks.

     http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskrespondingtobuttoneventsindatalistitems.asp

    Scott Mitchell has a very good post on this:

    http://forums.asp.net/p/580720/1909340.aspx

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter