DataList with linkbuttons

Discussion in 'ASP .Net Datagrid Control' started by Ugo, Aug 18, 2004.

  1. Ugo

    Ugo Guest

    Can anyone help?
    I have a DataList with 5 LinkButtons and for some reason my Item_Command
    event does not get
    triggered. My code is as follows:

    private void dlColorDetail_ItemDataBound(object sender,
    DataListItemEventArgs e)

    {

    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType ==
    ListItemType.AlternatingItem)

    {

    InfoStyleColorDetails color = (InfoStyleColorDetails) e.Item.DataItem;

    e.Item.ID= Convert.ToString(color.SKU);





    System.Web.UI.WebControls.LinkButton lbEvent = new
    System.Web.UI.WebControls.LinkButton();

    lbEvent.Text= Convert.ToString(color.SKU);

    e.Item.Controls.Add(lbEvent);

    lbEvent.Click += new System.EventHandler(LinkButton1_Click);



    }
    Ugo, Aug 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vidar Petursson

    Re: LinkButtons and MouseOver

    Vidar Petursson, Jul 8, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,243
    sramruttun
    Jul 9, 2003
  2. Rick Glos
    Replies:
    0
    Views:
    644
    Rick Glos
    Jul 8, 2003
  3. Lucas Tam

    LoadPostData and LinkButtons

    Lucas Tam, Aug 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    320
    Lucas Tam
    Aug 18, 2003
  4. Stefan Landgraf

    Linkbuttons not working

    Stefan Landgraf, Dec 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    333
    Stefan Landgraf
    Dec 11, 2003
  5. Nevyn Twyll
    Replies:
    8
    Views:
    1,867
Loading...

Share This Page