S
Singularity.co.uk
Hi
I have a repeater on the page which is displaying data from the database
correctly. My question is how can I modify the following code to add an
increasing number value before the database record:
<asp:Repeater id="rptPoint" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "ActionPoint") %>
</ItemTemplate>
</asp:Repeater>
At the moment my text comes back as:
Point1
Point2
Point3
Whereas i would like it coded so that it displays on the screen as:
1. Point1
2. Point2
3. Point3
If I was coding using classic asp, I would have added a count value and
displayed it in front of each point as follows:
<%
Dim PointCnt
PointCnt = 0
While Not rsRecordset.EOF
PointCnt = PointCnt + 1
Response.Write PointCnt & ". " &
rsRecordset.Fields.Item("PointValue").Value & "<br>"
rsRecordset.Movenext
Wend
%>
Any help is appreciated.
Thanks
Brendan
I have a repeater on the page which is displaying data from the database
correctly. My question is how can I modify the following code to add an
increasing number value before the database record:
<asp:Repeater id="rptPoint" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "ActionPoint") %>
</ItemTemplate>
</asp:Repeater>
At the moment my text comes back as:
Point1
Point2
Point3
Whereas i would like it coded so that it displays on the screen as:
1. Point1
2. Point2
3. Point3
If I was coding using classic asp, I would have added a count value and
displayed it in front of each point as follows:
<%
Dim PointCnt
PointCnt = 0
While Not rsRecordset.EOF
PointCnt = PointCnt + 1
Response.Write PointCnt & ". " &
rsRecordset.Fields.Item("PointValue").Value & "<br>"
rsRecordset.Movenext
Wend
%>
Any help is appreciated.
Thanks
Brendan