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. Advertisements

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,580
    sramruttun
    Jul 9, 2003
  2. Lucas Tam

    LoadPostData and LinkButtons

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

    Linkbuttons not working

    Stefan Landgraf, Dec 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    Stefan Landgraf
    Dec 11, 2003
  4. Cowboy
    Replies:
    1
    Views:
    390
    Joe Fallon
    May 27, 2004
  5. Trevor Benedict R
    Replies:
    1
    Views:
    593
    =?Utf-8?B?RGF2ZQ==?=
    Jun 19, 2004
  6. Nevyn Twyll
    Replies:
    8
    Views:
    2,332
  7. =?Utf-8?B?TWFqZWs=?=

    LinkButtons within Repeater control

    =?Utf-8?B?TWFqZWs=?=, Nov 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    508
    Scott Allen
    Nov 11, 2004
  8. =?Utf-8?B?dGhleWFzQGNvbW11bml0eS5ub3NwYW0=?=

    Making Linkbuttons show visited status accurately.

    =?Utf-8?B?dGhleWFzQGNvbW11bml0eS5ub3NwYW0=?=, Jan 10, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    388
    =?Utf-8?B?dGhleWFzQGNvbW11bml0eS5ub3NwYW0=?=
    Jan 10, 2005
Loading...