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);