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();
您可能感兴趣的文章: