i have a datalist that contains dynamic content.
i need to enable paging to this datalist.
im using asp.net c# under visual studion 2010
please send me the code how to enable the paging to the datalist!
here is the code for the datalist:
<asp:DataList ID="DataList1" runat="server" CellPadding="3"
DataSourceID="ObjectDataSource1" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" GridLines="Horizontal">
<AlternatingItemStyle BackColor="#F7F7F7" />
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<ItemTemplate>
<table>
<tr>
<td colspan="2">
<a href="<%#Eval(" rel="nofollow noreferrer noopener" rel="nofollow noreferrer noopener"VendorLink") %>"> <%# Eval("Vendor") %></a>
</td>
</tr>
<tr>
<td colspan="2">
<a href="<%#Eval(" rel="nofollow noreferrer noopener" rel="nofollow noreferrer noopener"TitleLink") %> "><%# Eval("Title") %></a>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="DescLabel" runat="server" Text='<%# Eval("Desc") %>' />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="DetailsLabel" runat="server" Text='<%# Eval("Details") %>' />
</td>
</tr>
<tr>
<td>
<asp:Label ID="LinksLabel" runat="server" Text='<%# Eval("Links") %>' />
</td>
</tr>
<tr>
<td> <asp:Label ID="RptIDLabel" runat="server" Text='<%# Eval("RptID") %>' /></td> </tr>
</table>
</ItemTemplate>
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
</asp:DataList>
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
here is the link for datalist paging example..
http://www.codeproject.com/KB/aspnet/paging.aspx
http://www.codeproject.com/KB/aspnet/DataListPaging.aspx
http://www.dotnetjohn.com/articles.aspx?articleid=48
http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0