I am creating buttons in a table programmatically and the click event has stopped working. I must have done something earlier in the page, as it used to work. Any suggestions as to where I might look would be much appreciated.
The buttons are built into a table row, one row for each record in the database:
Button btnModify = new Button(); btnModify.ID = "btnModify" + rowCnt.ToString(); btnModify.Text = "Modify"; btnModify.Click += new System.EventHandler(btn_OnClick); tCell.Controls.Add(btnModify); Button btnDelete = new Button(); btnDelete.ID = "btnDelete" + rowCnt.ToString(); btnDelete.Text = "Delete"; btnDelete.Click += new System.EventHandler(btn_OnClick); tCell.Controls.Add(btnDelete);
The only code I have in my page load is
during which I authenticate the user in active directory get the data related to their session. When the user clicks the button it never reaches btn_OnClick.
Thanks in advance for any help!