用List作为Repeater数据源 前台怎么绑数据
private void BindToRpt()
{
rptPowers.DataSource = GetData();
rptPowers.DataBind();
}
private List<StringBuilder> GetData()
{
List<StringBuilder> list = new List<StringBuilder>();
for (int i=0;i<20;i++)
{
StringBuilder controlStr = new StringBuilder();
controlStr.AppendLine("第"+i+"条数据");
list.Add(controlStr);
}
return list;
}
请问前台
<asp:Repeater ID="rptPowers" runat="server">
<HeaderTemplate><ul></HeaderTemplate>
<ItemTemplate>
<li><%# Eval("???????????")%></li>
</ItemTemplate>
<FooterTemplate></ul></FooterTemplate>
</asp:Repeater>
问号这里怎么绑
求高手赐教???????????????????????????
------解决方案--------------------
HTML code
<ItemTemplate>
<li><%# Container.DataItem %></li>
</ItemTemplate>