Hello,
I have read the very interesting article of Mudassar Khan about implementing paging in repeater control in ASP.NET (http://www.aspsnippets.com/Articles/Implement-Paging-in-Repeater-control-in-ASPNet.aspx); I'm trying this approach and I like it, It is what i was finding.
Now I need your help to customize the function he wrote to populate the pager control:
private void PopulatePager(int recordCount, int currentPage)
{
double dblPageCount = (double)((decimal)recordCount / Convert.ToDecimal(PageSize));
int pageCount = (int)Math.Ceiling(dblPageCount);
List<ListItem> pages = new List<ListItem>();
if (pageCount > 0)
{
for (int i = 1; i <= pageCount; i++)
{
pages.Add(new ListItem(i.ToString(), i.ToString(), i != currentPage));
}
}
rptPager.DataSource = pages;
rptPager.DataBind();
}
I need the paginator is something like that:
<FIRST><BACK>1,2,3....N<NEXT><LAST>
where first return back to first page, back go to previous current page, next for next page and last jump to last page.
How can I do that?
thank you very much