All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
php+ajax文件上传进度条_[PHP教程]
asp.net1.1和asp.net,2.0共存_[Asp.Net教程]
ACCESS改为SQL需要注意哪几个地方_[SQL,Server教程]
Visual C++ 6.0教程:Visual C++ 6.0概述
asp.net,页面事件:顺序与回传_[Asp.Net教程]
取得当前插入数据库中记录的id值_[PHP教程]
入门知识:动态网页PHP编程中字符串5个技巧_php资料_编程技术
使用有趣的自定义标记来布局页面_JavaScript技术_编程技术
ASP.NET技术获取IP与MAC地址的方法_[Asp.Net教程]
PHP技巧:PHP如何禁止图片文件的被盗链_[PHP教程]
Reading number is top 10 pictures
Ashlynn Brooke photograph of a group2
So beauty, will let you spray blood10
运动的范冰冰1
The most popular girls welcome eggplant
西游日记1
A beautiful girl to bud1
非常漂亮的泳装美女
狗狗与主人神同步2
云南大理的美女
The world's top ten most beautiful railway station2
Download software ranking
Unix video tutorial7
天龙八部十二宫服务端
Boxer vs Yellow5
matrix1
Tram sex maniac 2 (H) rar bag6
Tram sex maniac 2 (H) rar bag17
Tram sex maniac 2 (H) rar bag15
Boxer's Top ten classic battle3
终极变速大师Speeder3.26
Eclipse 4.2.1 For Win32
aaa published in(发表于) 2013/12/17 7:46:45 Edit(编辑)
入门:刚开始学.Net时写的分页类_.net资料_编程技术

入门:刚开始学.Net时写的分页类_.net资料_编程技术

入门:刚开始学.Net时写的分页类_.net资料_编程技术-你的首页-uuhomepage.com

共享的分页类,使用非常简单,试合初学者使用,但效率较低,使用的是PagedDataSource分页



public PagedDataSource GetPagedDataSource(DataSet MyDataSet,int PageSize,int PageNum,string AspxName,Label PageLable)
{
PagedDataSource PDS=new PagedDataSource();


PDS.AllowPaging=true;
PDS.PageSize=PageSize;
PDS.DataSource=MyDataSet.Tables[0].DefaultView;


int CurrentPage=0;
if(Convert.ToString(PageNum)!=null)
{
CurrentPage=int.Parse(PageNum.ToString());
}
else
{
CurrentPage=1;
}
PDS.CurrentPageIndex=CurrentPage-1;


int PageCount=PDS.PageCount;


string FirstPage=(PageNum==1)?("9"):("9");
string PrevPage=(PageNum==1)?("7"):("7");
string NextPage=(PageNum==(PageCount))?("8"):("8");
string LastPage=(PageNum==(PageCount))?(":"):(":");



PageLable.Text="总记录: "+PDS.DataSourceCount+"   每页: "+PageSize+"   总页数: "+PageCount+""+FirstPage+"  "+PrevPage+"  "+NextPage+"  "+LastPage+"";



return PDS;
}
调用示例


//PagedDataSource分页


string MySql="Select * from C_Company";
int PageNum=(Request.QueryString["Page"]==null)?(1):(Convert.ToInt32(Request.QueryString["Page"]));
MyDataSet=MyData.GetDataSet(MySql,0,0,"Table");
PagedDataSource PDS=new PagedDataSource();
PDS=MyData.GetPagedDataSource(MyDataSet,10,PageNum,Request.CurrentExecutionFilePath+"?",Label1);
this.DataGrid1.DataSource=PDS;
this.DataGrid1.DataBind();





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.