后台怎么获取
Label的值
- HTML code
<asp:Repeater ID="commentlist" runat="server"> <HeaderTemplate> </HeaderTemplate> <ItemTemplate> <tr> <td class="style1"> 第<asp:Label ID="Ranking" runat="server" Text="<%# (GetData() - 1) * GetDataall() + Container.ItemIndex + 1%>" ForeColor="#FF3399"></asp:Label> 名 </ItemTemplate> <FooterTemplate> </FooterTemplate> </asp:Repeater>
------解决方案--------------------------------------------------------
有个rpt_ItemBound事件中用e.FindControl()方法,或者用
for(int i=0;i<this.rpt.Items.Count;i++)
{
this.rpt.Items[i].FindControl(你的Label编号)
}
------解决方案--------------------------------------------------------
绑定的时候获取可以用ondatabound事件
------解决方案--------------------------------------------------------
楼上的任何一种都一样,ok的
------解决方案--------------------------------------------------------