asp.net gridview Repeater绑定数据列表显示序号
gridview
view sourceprint? <Columns>
<asp:TemplateField HeaderText="序号">
<ItemTemplate>
<SPAN style="COLOR: #0000ff"><%# Container.DataItemIndex +1 %>
</SPAN> </ItemTemplate>
</asp:TemplateField>
<asp:BoundField ....../>
...
</Columns>
Repeater
view sourceprint? <ItemTemplate>
<tr>
<SPAN style="COLOR: #0000ff"><td><%# Container.ItemIndex +1 %></td>
</SPAN> <td><%#Eval("NewsTitle")%> </td>
<td><%# DataBinder.Eval(Container.DataItem,"CreateTime","{0:yyyy-M-d}")%></td>
</tr>
</ItemTemplate>