DataList with linkbuttons

U

Ugo

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);



}
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top