Question

Im a ASP.NET beginner. I previously asked how to do some databinding to a repeater without a datasourse. Here. VB.NET Repeater Simple Data Binding Without Datasource

here is the solution someone got for me

Dim repeatTimes((TotalAdInsured)) As Integer

    myRepeater.DataSource = repeatTimes
    myRepeater.DataBind()

However, I now need to know how to get an index for each item in the repeater. ie

<% #index %>
Was it helpful?

Solution

    <asp:Repeater runat="server" ID="rptAwesome">
        <ItemTemplate>
            <%# Container.DataItem %> <%# Container.ItemIndex %><br />
        </ItemTemplate>
    </asp:Repeater>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top