1.问题1
Repeater1中有个Repeater2,Repeater2中有个Button,我想请问下,在Button的单击按钮下,怎么去找到Repeter2的ID?我要在button单击事件下,绑定Repter1中某一个Repter2中的数据....
protected void Button_Click(object sender, EventArgs e)
 {
   .
   .
   .
   Repter2.Datasouce=ds.table[0];
   Repter2.DataBind();
   关键现在找不到Repter2中的ID
 }
--------------------------------------------------------------------------------------------------------------2.问题2
Repeater1中有个Repeater2和一个linkbutton,Repeater2中有个Button,在button单击事件下怎么写,可以获得Repeater1的linkbutton的值

解决方案 »

  1.   

    问题1 用FindControl问题2 还是用FindControlRepeater 嵌套Repeater
      

  2.   

    FindControl ("repeater 的ClientID")
      

  3.   

    用findControl来查找,还有,按钮设定commandname属性值,事件可写在itemcommand函数中或者rowcommand函数
      

  4.   


      //你可以用一个lable标签来存储你要的值,在循环获取
     foreach (RepeaterItem item in DlHuiFuRen.Items)
                {
                    lblCommStr = ((Label)item.Controls[0].FindControl("lblAnComm")).Text;
                }
    2.问题是一样的,循环获得
      

  5.   

    只要你得到了当前点击的行repeater1 你的问题就可以解决了
    取得linkbutton不难 repeater1.rows[行编号(0)].FindControl("linkbutton的id")  
      

  6.   

    用FindControl这个例如DataList1_ItemCommand事件里面写:
      Label lbID = (Label)DataList1.Items[e.Item.ItemIndex].FindControl("LbBookID");
      

  7.   

    moneyNUMBER_1 说想法不错的。
    但目前。我不知道什么方法可以获得到[行编号(0)]
    请代码啊
      

  8.   

    大家看清楚我的题目啊。我的Repeater1中有个Repeater2,Repeater2中有个Button,嵌套中的嵌套啊
    想要找到我点击button的对应的repeater2。我现在无法找到repeater2的id.....
      

  9.   

    你先循环Repeater1才能拿到Repeater2的ID
      

  10.   

    repeatead.行绑定事件+=new 行绑定 在里面写就可以了