.NET实现Repeater控件+AspNetPager控件分页(2)

Tb_productsHelper helper = new Tb_productsHelper(); IList<Tb_productsInfo> list = helper.GetAllListBySql(product_sql); this.AspNetPager1.RecordCount = list.Count;//绑定总数量 this.AspNetPager1.AlwaysShow = true; //先声明一个分页类对象 PagedDataSource ps = new PagedDataSource(); ps.AllowPaging = true; ps.PageSize = this.AspNetPager1.PageSize; ps.CurrentPageIndex = this.AspNetPager1.CurrentPageIndex-1; ps.DataSource = list; this.rp.DataSource = ps; this.rp.DataBind();

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjwjfd.html