程序员的部落

导航

AspNetPager第三方控件分页代码

        private void BindData() {

            BLL.TrafficLine _TrafficLine = new Traffic.BLL.TrafficLine();
            DataSet ds = _TrafficLine.GetAllList();
          
                PagedDataSource pds = new PagedDataSource();
                pds.AllowPaging = true;
                pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
                pds.PageSize = 4;

                AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
                pds.DataSource = ds.Tables[0].DefaultView;
                Repeater1.DataSource = pds;
                Repeater1.DataBind();

        }

posted on 2009-04-02 10:17  程序员的部落  阅读(166)  评论(0编辑  收藏  举报