|
public void contrlRepeater(int page)
{
//page=当前页数-1;
List<FeedBack> temp = FeedBackManager.GetAllFeedBack();
int pagenum = 1;//每页显示的条数
int countpage=0;
if (temp.Count % pagenum == 0)
countpage = temp.Count / pagenum;
else
countpage = temp.Count / pagenum + 1;
LabCountPage.Text = countpage.ToString();//求总页数
//-----------显示隐藏首页和尾页
if (page == 0)
{
this.lbtnpritPage.Enabled = false;
this.lbtnFirstPage.Enabled = false;
}
else
{
this.lbtnpritPage.Enabled = true;
this.lbtnFirstPage.Enabled = true;
}
if (page == countpage-1)
{
this.lbtnNextPage.Enabled = false;
this.lbtnDownPage.Enabled = false;
}
else
{
this.lbtnNextPage.Enabled = true;
this.lbtnDownPage.Enabled = true;
}
//--------
int num = page * pagenum;//跳过num的条数,取pagenum
List<FeedBack> data = temp.Skip(num).Take(pagenum).ToList<FeedBack>();
Repeater1.DataSource = data;
Repeater1.DataBind();
}
|
|