法一:
用内部类PagedDataSource: 先创建对象,由DataSource属性获得数据源,之后它本身成为数据源,在绑定给数据控件(DataList),其他属性与GridView基本一致;
建对象:PagedDataSource pds = new PagedDataSource();
属 性:pds.AllowPaging = true;
pds.PageSize = 2;
//成为数据源
pds.DataSource = commentsInfo;
dlCommentInfo.DataSource = pds;