C# code <asp:Repeater ID="Repeater1"runat="server"> <ItemTemplate> <LI> <A href="#"target=_blank>天使之行:2009博爱志愿者行动精彩 </A> </LI> </ItemTemplate> </asp:Repeater>
每循环5条数据,插入 <li class="cline"> </li>
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
int i = 1;
if (i % 5 == 0 && i < 20) //这个20是Repeater1显示的记录总数,有多少写多少,以跳出循环
{
e.Item.Controls.Add(new LiteralControl("</LI><li class="cline">"));
}
i++;
}