private void Bind()
{
PagedDataSource pds = new PagedDataSource();
pds.DataSource = BasesetsManager.GetYQ();//方法绑定数据
pds.AllowPaging = true;
AspNetPager1.AlwaysShow = true;
AspNetPager1.RecordCount = pds.DataSourceCount;
AspNetPager1.PageSize = 10;
pds.PageSize = 10;
pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
gvlist.DataSource = pds;
gvlist.DataBind();
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
Bind();
}
本文介绍如何使用ASP.NET中的PagedDataSource进行分页处理,并结合AspNetPager控件实现动态页面导航。通过设置每页显示记录数及绑定GridView控件,实现了数据的有效展示。
1942

被折叠的 条评论
为什么被折叠?



