Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have presented my data retrieved from a DB in a repeater. unfortunately there are too many rows too show on one page. How can I allow paging when in a repeater?

 

################Code#################

<table border="0" cellspacing="0" cellpadding="0" width="100%" class="listText">

<asp:Repeater ID="productlist" runat="server" EnableViewState="true">

<HeaderTemplate>

<tr class="listHeader">

<td>#pic#</td><td>Navn</td><td align="right">Pris</td><td align="center">Kurv</th>

</tr>

</HeaderTemplate>

<ItemTemplate>

<tr>

<td>

<img src="" />

</td>

<td>

<a href="produkt.aspx">

<%# DataBinder.Eval(Container.DataItem, "ProductName")%>

</a>

</td>

<td align="right">

<%# DataBinder.Eval(Container.DataItem, "ProductPrice") %> kr.

</td>

<td align="center">

<a href="#">Tilføj</a>

</td>

</tr>

</ItemTemplate>

<AlternatingItemTemplate>

<tr bgcolor="lightblue">

<td>

<img src="" />

</td>

<td>

<a href="produkt.aspx">

<%# DataBinder.Eval(Container.DataItem, "ProductName")%>

</a>

</td>

<td align="right">

<%# DataBinder.Eval(Container.DataItem, "ProductPrice") %> kr.

</td>

<td align="center">

<a href="#">Tilføj</a>

</td>

</tr>

</AlternatingItemTemplate>

</asp:Repeater>

</table>

 

##################################

 

I can only see the 'AllowPaging' property for datagrids, how can I use paging functionality in a repeater. SHow me an example please.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...