I\'m building a in codebehind. The table is a listing of a database records (one record per row) and I neeed to add a delete button for each row. To do that, I of course ne
Your problem is that you're adding only the ClientID of your control to the html and not adding the control to the page itself.
Controls.Add(new LiteralControl(""));
foreach(var singleStudent in students)
{
Controls.Add(new LiteralControl(""));
//Code to add other columns
Button deleteButton = new Button();
deleteButton.ID = "deleteStudentWithID" + singleStudent.ID.ToString();
deleteButton.Text = "X";
Controls.Add(new LiteralControl(""));
Controls.Add(deleteButton);
Controls.Add(new LiteralControl(" ");
}
Controls.Add(new LiteralControl("
"));