循环获取文本框的值

 1 /// <summary>
 2 /// 遍历页面textbox
 3 /// </summary>
 4 private float ForText(string s) {
//System.Web.UI.WebControls.TextBox tbxTableMathScore = (System.Web.UI.WebControls.TextBox)gr_Main.Rows[rowIndex].FindControl("labMathScore");
5 FineUIPro.TextBox txt=(FineUIPro.TextBox)ContentPanel1.FindControl(s); 6 return float.Parse(txt.Text);
7 } 8 9 10 /// <summary> 11 /// 点击按钮事件 12 /// </summary> 13 protected void btnSave_Click(object sender, EventArgs e) 14 { 15 16   var model= new Student(); 17 18   string start_str = "A";//文本框id中带有A 19 20   model.name=ForText(start_str+"1"); 21 22   model.name=ForText(start_str+"2"); 23 24   model.name=ForText(start_str+"3"); 25 26 //执行sql脚本
  }
原文地址:https://www.cnblogs.com/xy0710/p/5033575.html