I am creating a table dynamically using c# and I am adding buttons to each cells. I need to assign button IDs for each of them so I can identify them later. I used following code for that.
bt.ID = rowIndex + c.ToString(); //bt.ID = "newID";
But when I try to access this button later it gives me an error.
Button seatButton = (Button)this.FindControl("a1");
seatButton.BackColor = Color.Red; //Gives an error here
seatButton.Enabled = false; //Gives an error here
I think the problem is with changing the button ID. I need to know the reason of this error and the cure..