日期:2014-05-17  浏览次数:20380 次

asp.nt问题,急!
前台我定义了两个 lable 分别叫  lable1 和 lable2

但是我后台不想直接这样写:lable1.text

我想这样写 lable + "i".text

有没有这样实现的方法 我知道我的写法是错误的


------解决方案--------------------
Label lbl = (Lable)this.FindControl(lable + "i");
lbl.Text...
------解决方案--------------------
Label l1 = FindControl("Label" + i) as Label;
l1.Text=
------解决方案--------------------
Label【】 leb = new Label【1】()
i=0
leb[i].text 
------解决方案--------------------
        for (int i = 1; i <= 自己设定的数字; i++)
        {
            id = "Label" + i;
            Label lbl = this.FindControl(id) as Label;
            lbl.Text;//取值
        }