kiki

kiki

  • NA
  • 24
  • 0

Datalist Paging - Page links/navigation

Jan 30 2008 2:44 PM
Hi,
I am working on a website and I have to reperesent the contents of a List<> in several pages. I use a PagedDataSource item and a DataList control for that. What I want to do is to create a links menu that will be created dynamicaly, it should look lke this

1 2 3 4 ... x Next

The List does not contain the same number of elements every time, and of course the number of pages is not stable. I have some code to make you understand better:

<asp:DataList id="DataList1" runat="server">
   <ItemTemplate>
                <%# Container.DataItem %>
   </ItemTemplate> 
</asp:DataList>



List<string> list1 = new List<string>;

System.Web.UI.WebControls.PagedDataSource pgds = new System.Web.UI.WebControls.PagedDataSource ();
pgds.DataSource = list1;
pgds.AllowPaging = true;
pgds.PageSize = 10;
DataList1.DataSource = pgds;


Can you help me and tell me what shoul I do to create this navigation-links bar;