gridview分页 repeater 分页

gridview分页

  GridView2.AllowPaging = true; 

  GridView2.PageIndex = 0;
     GridView2.DataBind();

 

 

repeater 分页 通过 PagedDataSource  CurrentPageIndex

DataTable dt = '连接数据库并查询'

     PagedDataSource pds = new PagedDataSource();

     pds.DataSource = dt.DefaultView;

     pds.AllowPaging = true;

     pds.PageSize = 2;

     pds.CurrentPageIndex = Convert.ToInt32(this.labPage.Text) - 1;

     Repeater1.DataSource = pds;

 

  

posted @ 2011-11-06 22:23  ltcnba  阅读(205)  评论(0编辑  收藏  举报