0
버튼을 클릭하여 테이블을 동적으로 생성하는 코드를 작성했습니다. 제대로 작동하는 코드를 작성합니다. 버튼을 다시 클릭하면 기존 테이블에 행을 추가하려고합니다. 도와주세요. 내 코드는 다음과 같습니다테이블을 동적으로 생성 하시겠습니까?
당신의 버튼 클릭에Table table = new Table();
table.ID = "Table1";
Page.Form.Controls.Add(table);
TableRow row = new TableRow();
TableCell cell = new TableCell();
TextBox tb = new TextBox();
// Set a unique ID for each TextBox added
tb.ID ="t1";
tb.Text = "sasi";
// Add the control to the TableCell
cell.Controls.Add(tb);
// Add the TableCell to the TableRow
row.Cells.Add(cell);
table.Rows.Add(row);