高手帮忙

解决方案 »

  1.   

    在绑定事件中使用FindControl方法得到
      

  2.   

    我知道是在itemdatabind里面,但是如何在这里面如何findcontrol呢?这个才是我想知道的啊
    因为在Itemdatabind里面是一系列数据,你怎么寻找某个textbox呢?
      

  3.   

    例如:
    this.lb_name.text=((TextBox) Repeater3.Items[zx].FindControl("text1")).Text);
      

  4.   

    TextBox txt = (TextBox)e.Item.FindControl("txtEM");
      

  5.   

    joan1027() 的方法根本不行,因为在itemdatabind里面就没有e.item
    还有,大家可能没明白我的意思
    我现在是repeater(r1)的模版列里面有利个repeater(r2),而要寻找的textbox在r2的模版列中,不是大家想的那么简单的
      

  6.   

    忘了说了zx就是一个int变量,在for循环中调用,第一个就是((TextBox) Repeater3.Items[0].FindControl("text1")).Text),以后就以此类推((TextBox) Repeater3.Items[1].FindControl("text1")).Text)
      

  7.   

    弄个类似各repeater里面嵌套的给你参考
    for(int ai=1;ai<=Repeater1.Items.Count ;ai++)
    {
      Repeater rptChild = (Repeater) Repeater1.Items[ai-1].FindControl("Repeater2");
      for(int n=1;n<=rptChild.Items.Count ;n++)
      {
        ((TextBox) rptChild.Items[n-1].FindControl("Textbox2")).Text=arrTmp[e_num];
        e_num++;
      }
    }