gridview
<Columns>
<asp:TemplateField HeaderText="序号">
<ItemTemplate>
<%# Container.DataItemIndex +1 %>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField ....../>
...
</Columns>
Repeater(用于不分页的情况下)
<ItemTemplate>
<tr>
<td><%# Container.ItemIndex +1 %></td>
<td><%#Eval("NewsTitle")%> </td>
<td><%# DataBinder.Eval(Container.DataItem,"CreateTime","{0:yyyy-M-d}")%></td>
</tr>
</ItemTemplate>