I am dynamically adding rows to an asp table. On each row of the table, I also include a button that has a SelectProduct_Click event.
The problem is that even if I register a click event, the event does not fire.
The button is added as follows:
btnSelect = new Button(); btnSelect.ID = "btnSelect"; btnSelect.CommandArgument = od.ProductId; btnSelect.Click += new EventHandler(this.SelectProduct_Click); btnSelect.CssClass = "button"; btnSelect.Text = "Select"; cell = new TableCell(); cell.Controls.Add(btnSelect); row.Cells.Add(cell);
How can I launch my button on a click?
source share