【发布时间】:2011-08-27 11:25:28
【问题描述】:
我正在编写用于在单击按钮时动态创建表的代码,我编写的代码工作正常,但是当我再次单击按钮时,我想将行添加到现有表中。请帮我。我的代码是:
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);
【问题讨论】:
标签: asp.net