Repeater ItemCommand not working in User Control and Community Server

rated by 0 users
This post has 1 Reply | 2 Followers

Keith Beers
Not Ranked
Posts 40
Points 530
By: Keith Beers
Posted: Wed, Dec 26 2007 2:29 PM

 I have this frustrating problem....I have a user control/custom repeater that I  originally wrote in .NET 1.1  Im now trying to port it into Community Server 2007 and ASP.NET 2. The ItemDatabound event is firing but for some reason the postbacks are never hitting the ItemCommand event handler....the postback is happening but Im not getting to the event handler

<asp:repeater id="rptProducts" runat="server">
  <itemtemplate>
    <div class="product">
      <h2 class="CommonTitle"><%# DataBinder.Eval(Container.DataItem, "Name"Wink %></h2>
      <div class="price">
                <div class="amount">
                    <span class="currency">$</span><%# DataBinder.Eval(Container.DataItem, "Price"Wink %>
        </div>
        <asp:imagebutton id="imgbtnAddToCart" commandargument='<%# DataBinder.Eval(Container.DataItem, "id"Wink %>'  cssclass="button" imageurl="AddToCart.jpg" runat="server" />
      </div>      
      <asp:label id="lblDescription" runat="server">
        <p class="description"><%# DataBinder.Eval(Container.DataItem, "Description"Wink %></p>
      </asp:label>
    </div>
  </itemtemplate>
</asp:repeater>

private void InitializeComponent()
{
   this.Load += new System.EventHandler(this.Page_Load);      this.rptProducts.ItemDataBound += new  
   RepeaterItemEventHandler(rptProducts_ItemDataBound);      this.rptProducts.ItemCommand += new
   RepeaterCommandEventHandler(rptProducts_ItemCommand);   
}

 

private void rptProducts_ItemCommand(object source, RepeaterCommandEventArgs e)
      {
         ImageButton btnSource = (ImageButton)e.CommandSource;....................

 
  • Post Points: 20 |
rutgersmit
Not Ranked
Posts 2
Points 10
By: rutgersmit
Posted: Tue, Jul 22 2008 4:04 AM In reply to

Keith,

 

Did you manage to solve this issue? I've got the exact same problem and I can't find a solution for it.

 

Cheers!
Rutger

 
  • Post Points: 5 |
Page 1 of 1 (2 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com