码迷,mamicode.com
首页 > 其他好文 > 详细

遍历所有lable并赋值

时间:2015-12-23 09:14:18      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

for (int i = 1; i <= dt.Rows.Count; i++)
{
(this.FindControl("lblhwmc" + i) as Label).Text = DataHelper.ToString(dt.Rows[i]["cgxm"]);
(this.FindControl("lblpp" + i) as Label).Text = DataHelper.ToString(dt.Rows[i]["pp"]);
(this.FindControl("lblggxh" + i) as Label).Text = DataHelper.ToString(dt.Rows[i]["gg"]);
(this.FindControl("lblysje" + i) as Label).Text = DataHelper.ToString(dt.Rows[i]["dj"]);
(this.FindControl("lblcjj" + i) as Label).Text = DataHelper.ToString(dt.Rows[i]["scdj"]);
(this.FindControl("lblsl" + i) as Label).Text = DataHelper.ToString(dt.Rows[i]["sl"]);
(this.FindControl("lblxj" + i) as Label).Text = DataHelper.ToString(dt.Rows[i]["scjg"]);

}

遍历所有lable并赋值

标签:

原文地址:http://www.cnblogs.com/kaiwanlin/p/5068811.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!