循环获取文本框的值

 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脚本
  }

 

posted @ 2015-12-09 17:30  常威打来福  阅读(560)  评论(0编辑  收藏  举报