views:

515

answers:

1

Hi, Im a ASP.NET beginner. I previously asked how to do some databinding to a repeater without a datasourse. Here. http://stackoverflow.com/questions/926619/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 %>
A: 
    <asp:Repeater runat="server" ID="rptAwesome">
        <ItemTemplate>
            <%# Container.DataItem %> <%# Container.ItemIndex %><br />
        </ItemTemplate>
    </asp:Repeater>
Juliet
ok, now have this problem, when I try to do that 'AdTitle<%# Container.DataItem %>' is not a valid identifier.<asp:DropDownList ID="AdTitle<%# Container.DataItem %>" runat="server">
Mark: <%# ... %> is not a preprocessing directive. See here: (http://stackoverflow.com/questions/370201/why-will-expressions-as-property-values-on-a-server-controls-lead-to-a-compi/370263#370263). In any case, whatever you're attempting to do with the ID property is almost certainly wrong. Post another question which explains exactly what you're trying do.
Juliet