I am dynamically adding rows in an asp table. In each row of the table I am also including a button which has a SelectProduct_Click event.
The problem is that even though I am registering the click event, the event is not being fired.
The button is being added in this way:
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 get my button to fire on click?