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
来源:http://www.cnblogs.com/chendaoyin/archive/2013/05/17/3083449.html
发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。