Using the below method, you can declare a counter before the loop and increment it at the end of each loop to keep track of your row number.
The rest of the answer taken in full from from: https://stackoverflow.com/a/14732922/2617732
Rather than use a repeater, you can just loop through the list in a similar MVC type way using the <% %> and <%= %> tags.
<table>
<% foreach (var myItem in g) { %>
<tr><td><%= myItem.title %></td></tr>
<% } %>
</table>
As long as the property you're looping through is acessible from the aspx/ascx page (e.g. declared as protected or public) you can loop through it. There is no other code in the code behind necessary.
<% %> will evaluate the code and <%= %> will output the result.
Here is the most basic example:
Declare this list at your class level in your code behind:
public List Sites = new List { "StackOverflow", "Super User", "Meta SO" };
That's just a simple list of strings, so then in your aspx file
<% foreach (var site in Sites) { %> <!-- loop through the list -->
<div>
<%= site %> <!-- write out the name of the site -->
</div>
<% } %> <!--End the for loop -->