新增TextBox控制項讀取輸入值
動態新增textBox
TextBox txt = new TextBox();
txt.ID = "textBox1";
cell = new TableCell();
cell.Controls.Add(txt);
按鈕事件中抓取txt、lable值
TextBox txt = (TextBox)Table1.FindControl("textBox1");
var txtStr = txt.Text;
Label lab = (Label)Table1.FindControl("Lab1");
var labStr = lab.Text;
Button可透過按鈕sender來獲取,而 TextBox 及 Lable 需使用FindControl的方式來獲取此控制項