Repeater :行号
<%# DataBinder.Eval(Container,"ItemIndex")%>
Repeater这个控件没法帮你传递Row中的信息,所以常用.Items[i].FindControl这种方式取得某行的子控件,需要注意的是,这只能得到客户端该控件的用户行为,比如说checkbox控件是否被选中,但没法传递数据,因为这样是不行的,得不到Text的值的,用因此,这里可以使用数据源来传递数据,如下代码段:
ASP.NET备忘for (int i = 0; i < this.slidelist.Items.Count; i++
  

           
if (int.Parse(dt_source.Rows[i]["intID"].ToString()) + ""> 0
          

             HtmlInputCheckBox cb 
= this.slidelist.Items[i].FindControl("CheckBox1"as HtmlInputCheckBox; 
             cb.Checked 
= true
           }
 
  }

ASP.NET备忘

相关文章:

  • 2021-07-20
  • 2021-07-20
  • 2022-12-23
  • 2021-08-18
猜你喜欢
  • 2021-12-27
  • 2022-01-26
  • 2022-12-23
  • 2021-11-27
  • 2021-06-30
  • 2021-12-23
  • 2021-08-01
相关资源
相似解决方案