Please replace the following code in
BindRepeaterData function
rptPaging.Visible = true;
ArrayList pages = new ArrayList();
for (int i = 0; i < pgitems.PageCount; i++)
pages.Add((i + 1).ToString());
rptPaging.DataSource = pages;
rptPaging.DataBind();
with
rptPaging.Visible = true;
int iStartIndex = (pgitems.CurrentPageIndex/5)*5+1;
int iEndIndex = iStartIndex+4;
if(iEndIndex > pgitems.PageCount-1)
{
iEndIndex = pgitems.PageCount-1;
}
ArrayList pages = new ArrayList();
for (int i = iStartIndex; i <= iEndIndex ; i++)
pages.Add((i + 1).ToString());
rptPaging.DataSource = pages;
rptPaging.DataBind();
I hope this will help you... :)