最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net PagedDataSource分页实现代码
时间:2010-12-19 编辑:简简单单 来源:一聚教程网
private void databind(ilist
datasource,int count)
{
pageddatasource pds = new pageddatasource();
pds.datasource = datasource;
pds.allowpaging = true;
pds.pagesize = 10;
pds.currentpageindex = index;
viewstate["allpage"] = pds.pagecount;
if (index == 0)
{
this.imgpre.visible = false;
this.imgfrist.visible = false;
}
else if (index == pds.pagecount - 1)
{
this.imgnext.visible = false;
this.imgend.visible = false;
}
if (count == 0)
{
this.lblcount.text = "对不起,没有您要查询的记录;";
this.imgpre.visible = false;
this.imgfrist.visible = false;
this.imgnext.visible = false;
this.imgend.visible = false;
}
else if (count<=10)
{
this.lblcount.text = "共 " + count + " 条数据 当前 " + (pds.currentpageindex + 1) + "/" + pds.pagecount + " 页";
this.imgpre.visible = false;
this.imgfrist.visible = false;
this.imgnext.visible = false;
this.imgend.visible = false;
}
else
{
this.lblcount.text = "共 " + count + " 条数据 当前 " + (pds.currentpageindex + 1) + "/" + pds.pagecount + " 页";
}
this.gridview1.datasource = pds;
this.gridview1.databind();
}
-
上一个: C#提高xml读写速度方法
-
下一个: asp.net api正则表达式
相关文章
- asp.net pager分页控件实现代码 01-05
- C#复制数组的两种方式及效率比较解读 10-24
- ASP.NET Identity用法解析 10-24
- ASP.NET MVC使用Identity增删改查用户介绍 10-24
- C语言中atoi函数模拟实现介绍 10-18
- .Net反向代理组件Yarp用法介绍 10-10