一点按钮,传入一个姓名数组:(张三,王武,李四),那么Table中生成3行数据,并动态生成控件,并且DropDownList绑定DaTaTable//列名→ 姓名 亚信ID 1日 2日
//自动生成1 TextBox TextBox DropDownList DropDownList
//自动生成2 TextBox TextBox DropDownList DropDownList
//自动生成3 TextBox TextBox DropDownList DropDownList 行数据生成后,用户填写相应数据,点保存按钮,将以上3列数据保存到数据库中(数据库中应保存为3条数据)。
//自动生成1 TextBox TextBox DropDownList DropDownList
//自动生成2 TextBox TextBox DropDownList DropDownList
//自动生成3 TextBox TextBox DropDownList DropDownList 行数据生成后,用户填写相应数据,点保存按钮,将以上3列数据保存到数据库中(数据库中应保存为3条数据)。
通过改变数据源,重新绑定,来实现。只需要在数据源动态增加一个DataRow就Ok了。
TableCell cell = new TableCell();
TextBox txt=new TextBox();
txt.Id="txt";
cell.Controls.Add(txt);
row.Cells.Add(cell);
HolderTable.Rows.Add(row);或js添加
或gridview等数据绑定控件添加一行