当前位置: 代码迷 >> ASP.NET >> Repeater查找控件解决方案
  详细解决方案

Repeater查找控件解决方案

热度:6474   发布时间:2013-02-25 00:00:00.0
Repeater查找控件
我想在显示数据时,根据不同需要修改dataset中rows里面的数据再绑定到Repeater控件
在ItemDataBound过程中用e.Item.FindControl找到了控件lable
但怎样区分这是哪一条记录的label呢?
我用
dim p as label
dim introw as integer=objdataset.Tables("result").Rows.Count
For i = 0 To introw - 1 Step 1
p = e.Item.FindControl("content1")
str = objdataset.Tables("result").Rows(i)("content").ToString
p.Text = str
Next
可得到的5条记录全部相同,均与第一条记录相同  


------解决方案--------------------------------------------------------
p = e.Item.FindControl("content1") ID都没有表示 ID要唯一值
  相关解决方案