Repeater没有自带的分页功能,于是用了AspNetPager分布组件,代码如下:

var sWhere = string.Format(" Serviceid={0} ", sId);


            var mDataTable = DAL.Log.GetList(sWhere).Tables[0];
            AspNetPager1.RecordCount = mDataTable.Rows.Count;

            var pds = new PagedDataSource
            {
                DataSource = mDataTable.DefaultView,
                CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1,
                PageSize = AspNetPager1.PageSize,
                AllowPaging = true
            };
            Repeater1.DataSource = pds;
            Repeater1.DataBind();

AspNetPage的数据源连的是DataTable

相关文章:

  • 2022-12-23
  • 2021-10-27
  • 2021-10-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-06-04
  • 2021-07-16
猜你喜欢
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2021-12-05
  • 2021-06-26
相关资源
相似解决方案