fasil Posted April 8, 2005 Posted April 8, 2005 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. Quote
Moderators Robby Posted April 9, 2005 Moderators Posted April 9, 2005 I don't use a repeater so I'm not sure how to page with it. One note though, you cannot place a control between the <table> and <tr> tags. Quote Visit...Bassic Software
michael_hk Posted April 11, 2005 Posted April 11, 2005 http://aspnet.4guysfromrolla.com/articles/081804-1.aspx Quote There is no spoon. <<The Matrix>>
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.