| 订阅 | 在线投稿
分享
 
 
 

ASP分页代码的学习

2008-09-18 07:06:53 编辑來源:互联网 国际版 评论
 
 
本文为【ASP分页代码的学习】的汉字拼音对照版显示拼音
  <%

  '******************************************************************

  '** benchengxuming"wuxianliu"fenyechengxu

  '** zuozheArbiter(AAsx)

  '** banbenMillion Level

  '**

  '** QQ22222xx

  '** EmailArbiter@21cn.com

  '** http://www.imagecity.org/

  '******************************************************************

  '**

  '** zuozhedehua

  '**

  '** fenyechengxuwuyishixuduowangluochengxugongnengzhongyigebijiaomafandedong西xishishishangxianzai

  '** weizhijuedabufenrenhuanshizai使shiyongchuantongdefenyefangfa(Rs.PageSize=xx)erlejie

  '** shujukucaozuoderendouzhidaozhezhongchuantongfangshiyougebiduandiyicidakaiyemianshi

  '** tahuiyudusuoyoudejilujizhedangzaishujudadeshihouzhejiangshizhimingdeerqiejie

  '** xialaidefanyesuduyehuifeichangmanhenzhanyongziyuanduiyushiwanshuliangjiyishangdeshuju

  '** kuzhezhongchuantongfenyefangshiyijingxiandefeichangwuligengbieshuobaiwanjilegenbenmeifacao

  '** zuojiyuzhezhongyuanyincu使shiwozuolebenchengxu

  '**

  '** chengxugongneng

  '**

  '** zhenduidaxingdeshujukujinxingfenyecaozuolixiangdekecaozuodeshujujiluliangzai200wan

  '** yinei(Max Levelbanjiangwushuliangxianzhiqiewulunshujukuduodafanyesududoushi

  '** bubian)zheshiMillion Levelbanfenyechengxuzaisaiyang1Gneicun512win2khuan

  '** jingxiadeceshishuju

  '**

  '** SQLserver 2k + 10wantiaojilu + meiyexianshi20tiao

  '** pingyunfanyesudu45ms

  '** SQLserver 2k + 100wantiaojilu + meiyexianshi20tiao

  '** pingyunfanyesudu350ms

  '**

  '**

  '** fenyeyuanli

  '**

  '** benchengxubuzai使shiyongRs.PageSizedefangshifenyelianjieshujukudeyoubiaoleixing

  '** yebushi使shiyongconn,1,xershiconn,0,1zheyingshizuikuaideyoubiaoleixinglebuyao

  '** yiweizheyanghui使shichengxubiandefuduoxiangfanchengxufeichangjiandanruguonikanbumingbai

  '** yinggaishiwodebianchengfenggenibuxiguanerfeichengxufuduo

  '** "wuxianliu"fenyedezhongxinshimeiyezhiduchuxuyaoxianshidejilubuzaixiangchuantong

  '** fenyechengxuyuduquanbudeshujuzhezhengzaibenchengxuzuidadeyoudian--zhanyongziyuanshaotong

  '** lisuduyededaofeichangdadetishengtebiezaishujuliangyuedadeshihoutadesuduyoushi

  '** yuemingxian100wanjilucai350mszuoyou

  '** dangchengxuzhixinghou使shiyongCurcorBeginheCurcorEndjiluxianshidediyitiaoji

  '** luhezuihouyitiaojiludeIDzhizuoweixiayicifanyedebiaojiranhouliyongTop xxqu

  '** chuxuyaodeshujuxianshitongshiyouzaiduiIDzhijinxingjilu

  '**

  '** jie yan

  '**

  '** benchengxuweigongxiangbantigonggeigechengxuaihaozheyanjiu使shiyongruoyaozhuanzaisanboxiu

  '** gaihuozuoqitayongtuqingzunchongzuozhedexinlaozhumingchuchu

  '** ruguobenchengxuzhongyoucuoloufeizuiyouhuadengquedianqingdaowww.csdn.netdeWebkaifa/

  '** ASPlanmuzhongfabiaotaolunweilezhongguoruanjianshiyedefazhanqingbuyaogubuzifeng

  '**

  '********************************************************************

  Option Explicit

  'Response.Flush

  Dim BeginTime,EndTime

  BeginTime=Timer

  Dim conn,SQLstr,Rs,DefRecordNum,CursorBegin,CursorEnd,CurPageNum,hav

  DefRecordNum=20

  '--------------huoquxiangguanshenshu----------

  If Request("CursorBegin")="" Then CursorBegin=0 Else CursorBegin=Request("CursorBegin")

  If Request("CursorEnd")="" Then CursorEnd=0 Else CursorEnd=Request("CursorEnd")

  If Request("CurPageNum")<>"" Then

  CurPageNum=CLng(Request("CurPageNum"))

  If CurPageNum<=0 Then CurPageNum=1

  Else

  CurPageNum=1

  End If

  hav=Request("hav")

  If hav="" Then hav="next"

  '----------------End-----------------

  '------------xianshifanyeneironghanshu--------

  Function TurnPageFS(DispRecordNum)

  Dim n

  While Not(Rs.Eof) And n<DispRecordNum

  n=n+1

  Response.Write "<tr>"&_

  "<td bgcolor='efefef'>"&Rs(0)&"</td>"&_

  "<td bgcolor='efefef'>"&Rs(1)&"</td>"&_

  "<td bgcolor='efefef'>"&Rs(2)&"</td>"&_

  "<td bgcolor='efefef'>"&Rs(3)&"</td>"&_

  "<td bgcolor='efefef'>"&Rs(4)&"</td>"&_

  "<td bgcolor='efefef'>"&Rs(5)&"</td>"&_

  "</tr>"

  If n=1 Then CursorBegin=Rs(0)

  If n=DefRecordNum Or Rs.Eof Then CursorEnd=Rs(0)

  Rs.MoveNext

  Wend

  End Function

  '-------------lianjieshujuku-------------

  Set conn=Server.CreateObject("Adodb.Connection")

  'SQLstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("mldata.mdb")

  SQLstr="Driver={SQL Server};server=arbiter;uid=arbiter;pwd=123456;database=mldata"

  conn.Open SQLstr

  '---------tongjizongjilushu/zongyeshu---------

  '-PStuijian使shiyongcount(ID)IDweizidongbianhaoqiesuoyinfouzesuduyoukenengdadazhekou

  '-PScitongjishibenchengxuzhongzuihaoziyuandeyibufenruguoquxiaozheduanchengxusuduhuikuaishang10beizuoyou

  Dim TotalRecords,TotalPages

  SQLstr="Select count(ID) As RecordSum From ABC"

  Set Rs=conn.Execute(SQLstr,0,1)

  TotalRecords=Rs("RecordSum")

  TotalPages=Abs(Int(TotalRecords/DefRecordNum*(-1)))

  Rs.Close

  Set Rs=Nothing

  '--------genjuhavxuanzexiangyingdeSQLzichuan-----

  Select Case(hav)

  Case "back"

  CursorEnd=CursorBegin

  SQLstr="Select Top "&DefRecordNum&"_

  ID,Title,FileName,K,ImgSize,NameSon _

  From ABC Where ID<"&CursorBegin&_

  " And ID In (Select Top "&DefRecordNum_

  &" ID From ABC Where ID<"&CursorBegin_

  &" Order by ID DESC) Order by ID"

  Case "next"

  SQLstr="Select Top "&DefRecordNum_

  &" ID,Title,FileName,K,ImgSize,NameSon From ABC Where ID>"&CursorEnd&_

  " Order by ID"

  End Select

  Set Rs=conn.Execute(SQLstr,0,1)

  %>

  <html>

  <head>

  <title>"wuxianliu"fenyechengxuzuozheArbiter</title>

  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

  <style type="text/css">td,br,div,p,body {font-size:12px}</style>

  </head>

  <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">

  <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#E2F5FE">

  <tr align="center">

  <td colspan="2"><%Response.Write CurPageNum&"/"&TotalPages&"ye zongjilushu"&TotalRecords%></td>

  <td><a href="mllist.asp">shouye</a> <a href=javascript:turnpage('back');>shangyiye</a>

  <a href=javascript:turnpage('next');>xiayiye</a> </td>

  </tr>

  </table>

  <table width="100%" border="1" cellspacing="0" cellpadding="3" bgcolor="#CCCCCC">

  <tr>

  <td>ID</td>

  <td>Title</td>

  <td>FileName</td>

  <td>daxiao</td>

  <td>chicun</td>

  <td>leibie</td>

  </tr>

  <%

  TurnPageFS(DefRecordNum)

  Rs.Close

  Set Rs=Nothing

  conn.Close

  Set conn=Nothing

  %>

  </table>

  <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#E2F5FE">

  <tr align="center">

  <td colspan="2"><%Response.Write CurPageNum&"/"&TotalPages&"ye zongjilushu"&TotalRecords%></td>

  <td><a href="mllist.asp">shouye</a> <a href=javascript:turnpage('back');>shangyiye</a>

  <a href=javascript:turnpage('next');>xiayiye</a> </td>

  </tr>

  </table>

  <%

  EndTime=Timer

  Response.Write "<br>chengxuzhixingshijian"&(EndTime-BeginTime)*1000&"haomiao"

  Response.Write " diyitiaojiludeIDzhi(CursorBegin)="&CursorBegin&" "

  Response.Write "zuihouyitiaojiludeIDzhi(CursorEnd)="&CursorEnd&"<br><br>"

  %>

  <script language="javascript">

  function turnpage(func){

  var CurPageNum=<%=CurPageNum%>; //qudedangqianyema

  var CursorBegin=<%=CursorBegin%>; //qudediyigexianshidejiludeIDzhi

  var CursorEnd=<%=CursorEnd%>; //qudezuihouyigexianshidejiludeIDzhi

  var TotalPages=<%=TotalPages%>; //qudeyemianzongshu

  var BackUrl='mllist.asp?CurPageNum='+(CurPageNum-1)+'&CursorBegin='+CursorBegin+'&CursorEnd='+CursorEnd+'&hav=back';

  var NextUrl='mllist.asp?CurPageNum='+(CurPageNum+1)+'&CursorBegin='+CursorBegin+'&CursorEnd='+CursorEnd+'&hav=next';

  if(CurPageNum<=1 && func=='back'){

  location.href='#';

  }else if(CurPageNum>=TotalPages && func=='next'){

  location.href='#';

  }else if(func=='back'){

  location.href=BackUrl;

  }else if(func='next'){

  location.href=NextUrl;

  }

  }

  </script>

  </body>

  </html>

  Cnbrucededaima

  fenyeyangli[shouye] [shangye] [xiaye] [yiye] [yeci4/5ye] [gong86pian 20pian/ye] zhuandao_ ye

  yixiaweigongyongdaimabixujubei

  <%filepath=request.servervariables("path_info")%>

  <%page=1 'shezhibianliangchushizhiPAGE=1

  page=request.querystring("page") 'pagezhiweijieshouzhi

  rs.PageSize = 20 'meiyexianshijilushu

  if Not IsEmpty(trim(Request("Page"))) then 'ruguoPAGEyijingchushihua...

  Page = CInt(Request("Page")) 'jieshouPAGEbinghuaweishuzixingfugeiPAGEbianliang

  if Page > rs.PageCount then 'ruguojieshoudeyeshudayuzongyeshu

  rs.AbsolutePage = rs.PageCount 'shezhidangqianxianshiyedengyuzuihouye

  elseif Page <= 0 then 'ruguopagexiaoyudengyu0

  Page = 1 'shezhiPAGEdengyudiyiye

  else

  rs.AbsolutePage = Page 'ruguodayuling,xianshidangqianyedengyujieshoudeyeshu

  end if

  End if

  Page = rs.AbsolutePage%>

  diyizhongfenye

  <%if rs.pagecount<>1 and rs.pagecount<>0 then%>'shouxianpanduanyezongshubuwei1he0

  <%if page>1 then%>

  <%if page<rs.pagecount then %>

  [<a Href="<%=filepath%>?Page=<% = 1%>">shouye</a>]

  [<a Href="<%=filepath%>?Page=<% = page -1 %>">shangyiye</a>]

  [<a Href="<%=filepath%>?Page=<% = page + 1%>">xiayiye</a>]

  [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">yiye</a>]

  <%else%>

  [<a Href="<%=filepath%>?Page=<% = 1%>">shouye</a>]

  [<a Href="<%=filepath%>?Page=<% = page -1 %>">shangyiye</a>]

  [xiayiye] [yiye]

  <% end if %>

  <%else%>

  [shouye] [shangyiye]

  [<a Href="<%=filepath%>?Page=<% = page + 1%>">xiayiye</a>]

  [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">yiye</a>]

  <%end if %>

  <%else%>

  [shouye] [shangyiye] [xiayiye] [yiye]

  <%end if%>

  dierzhongfenye

  <%if rs.pagecount<>1 and rs.pagecount<>0 then%>

  <%if page>1 then%>

  [<a Href="<%=filepath%>?Page=<% = 1%>">shouye</a>]

  [<a Href="<%=filepath%>?Page=<% = page -1 %>">shangyiye</a>]

  <%if page<rs.pagecount then %>

  [<a Href="<%=filepath%>?Page=<% = page + 1%>">xiayiye</a>]

  [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">yiye</a>]

   <%else%>

   [xiayiye] [yiye]

  <% end if %>

  <%else%>

  [shouye] [shangyiye]

  [<a Href="<%=filepath%>?Page=<% = page + 1%>">xiayiye</a>]

  [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">yiye</a>]

  <%end if %>

  <%else%>

  [shouye] [shangyiye] [xiayiye] [yiye]

  <%end if%>

  disanzhong

  <%if rs.pagecount<>1 and rs.pagecount<>0 then%>

  <%if page<rs.pagecount then%>

  <%if page=1 then %>

  [shouye] [shangyiye]

  <%else%>

  [<a Href="<%=filepath%>?Page=<% = 1%>">shouye</a>]

  [<a Href="<%=filepath%>?Page=<% =page -1 %>">shangyiye</a>]

  <% end if %>

  [<a Href="<%=filepath%>?Page=<% = page + 1%>">xiayiye</a>]

  [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">yiye</a>]

  <%else%>

  [<a Href="<%=filepath%>?Page=<% = 1%>">shouye</a>]

  [<a Href="<%=filepath%>?Page=<% =page -1 %>">shangyiye</a>]

  [xiayiye] [yiye]

  <%end if %>

  <%else%>

  [shouye] [shangyiye] [xiayiye] [yiye]

  <%end if%>原文
 
 
<% '****************************************************************** '** 本程序名:"无限流"分页程序 '** 作者:Arbiter(AAsx) '** 版本:Million Level '** '** QQ:22222xx '** Email:[url=mailto:Arbiter@21cn.com]Arbiter@21cn.com[/url] '** [url=http://www.imagecity.org/]http://www.imagecity.org/[/url] '****************************************************************** '** '** 【作者的话】 '** '** 分页程序无疑是许多网络程序功能中一个比较麻烦的东西,事实上现在 '** 为止绝大部分人还是在使用传统的分页方法(Rs.PageSize=xx),而了解 '** 数据库操作的人都知道,这种传统方式有个弊端:第一次打开页面时, '** 它会预读所有的记录集,这当在数据大的时候,这将是致命的,而且接 '** 下来的翻页速度也会非常慢,很占用资源。对于十万数量级以上的数据 '** 库这种传统分页方式已经显得非常无力,更别说百万级了(根本没法操 '** 作)。基于这种原因,促使我做了本程序。 '** '** 【程序功能】 '** '** 针对大型的数据库进行分页操作,理想的可操作的数据记录量在200万 '** 以内(Max Level版将无数量限制,且无论数据库多大,翻页速度都是 '** 不变),这是Million Level版分页程序在赛扬1G、内存512、win2k环 '** 境下的测试数据: '** '** SQLserver 2k + 10万条记录 + 每页显示20条: '** 平均翻页速度:45ms '** SQLserver 2k + 100万条记录 + 每页显示20条: '** 平均翻页速度:350ms '** '** '** 【分页原理】 '** '** 本程序不再使用Rs.PageSize的方式分页,连接数据库的游标类型 '** 也不是使用conn,1,x,而是conn,0,1,这应是最快的游标类型了,不要 '** 以为这样会使程序变得复杂,相反,程序非常简单,如果你看不明白, '** 应该是我的编程风格你不习惯,而非程序复杂。 '** "无限流"分页的中心是:每页只读出需要显示的记录,不再象传统 '** 分页程序预读全部的数据,这正在本程序最大的优点--占用资源少,同 '** 理速度也得到非常大的提升,特别在数据量越大的时候,它的速度优势 '** 越明显(100万记录才350ms左右)。 '** 当程序执行后,使用CurcorBegin和CurcorEnd记录显示的第一条记 '** 录和最后一条记录的ID值,作为下一次翻页的标记,然后利用Top xx取 '** 出需要的数据显示,同时又再对ID值进行记录。 '** '** 【结 言】 '** '** 本程序为共享版,提供给各程序爱好者研究使用,若要转载、散播、修 '** 改或作其他用途,请尊重作者的辛劳,注明出处。 '** 如果本程序中有错漏、非最优化等缺点,请到[url=http://www.csdn.net]www.csdn.net[/url]的Web开发/ '** ASP栏目中发表讨论,为了中国软件事业的发展,请不要固步自封:) '** '******************************************************************** Option Explicit 'Response.Flush Dim BeginTime,EndTime BeginTime=Timer Dim conn,SQLstr,Rs,DefRecordNum,CursorBegin,CursorEnd,CurPageNum,hav DefRecordNum=20 '--------------获取相关参数---------- If Request("CursorBegin")="" Then CursorBegin=0 Else CursorBegin=Request("CursorBegin") If Request("CursorEnd")="" Then CursorEnd=0 Else CursorEnd=Request("CursorEnd") If Request("CurPageNum")<>"" Then CurPageNum=CLng(Request("CurPageNum")) If CurPageNum<=0 Then CurPageNum=1 Else CurPageNum=1 End If hav=Request("hav") If hav="" Then hav="next" '----------------End----------------- '------------显示翻页内容函数-------- Function TurnPageFS(DispRecordNum) Dim n While Not(Rs.Eof) And n<DispRecordNum n=n+1 Response.Write "<tr>"&_ "<td bgcolor='efefef'>"&Rs(0)&"</td>"&_ "<td bgcolor='efefef'>"&Rs(1)&"</td>"&_ "<td bgcolor='efefef'>"&Rs(2)&"</td>"&_ "<td bgcolor='efefef'>"&Rs(3)&"</td>"&_ "<td bgcolor='efefef'>"&Rs(4)&"</td>"&_ "<td bgcolor='efefef'>"&Rs(5)&"</td>"&_ "</tr>" If n=1 Then CursorBegin=Rs(0) If n=DefRecordNum Or Rs.Eof Then CursorEnd=Rs(0) Rs.MoveNext Wend End Function '-------------连接数据库------------- Set conn=Server.CreateObject("Adodb.Connection") 'SQLstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.Mappath("mldata.mdb") SQLstr="Driver={SQL Server};server=arbiter;uid=arbiter;pwd=123456;database=mldata" conn.Open SQLstr '---------统计总记录数/总页数--------- '-PS:推荐使用count(ID),ID为自动编号且索引,否则速度有可能大打折扣 '-PS:此统计是本程序中最耗资源的一部分,如果取消这段程序,速度会快上10倍左右 Dim TotalRecords,TotalPages SQLstr="Select count(ID) As RecordSum From ABC" Set Rs=conn.Execute(SQLstr,0,1) TotalRecords=Rs("RecordSum") TotalPages=Abs(Int(TotalRecords/DefRecordNum*(-1))) Rs.Close Set Rs=Nothing '--------根据hav选择相应的SQL字串----- Select Case(hav) Case "back" CursorEnd=CursorBegin SQLstr="Select Top "&DefRecordNum&"_ ID,Title,FileName,K,ImgSize,NameSon _ From ABC Where ID<"&CursorBegin&_ " And ID In (Select Top "&DefRecordNum_ &" ID From ABC Where ID<"&CursorBegin_ &" Order by ID DESC) Order by ID" Case "next" SQLstr="Select Top "&DefRecordNum_ &" ID,Title,FileName,K,ImgSize,NameSon From ABC Where ID>"&CursorEnd&_ " Order by ID" End Select Set Rs=conn.Execute(SQLstr,0,1) %> <html> <head> <title>"无限流"分页程序  作者:Arbiter</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style type="text/css">td,br,div,p,body {font-size:12px}</style> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"> <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#E2F5FE"> <tr align="center"> <td colspan="2"><%Response.Write CurPageNum&"/"&TotalPages&"页 总记录数:"&TotalRecords%></td> <td><a href="mllist.asp">首页</a> <a href=javascript:turnpage('back');>上一页</a> <a href=javascript:turnpage('next');>下一页</a> </td> </tr> </table> <table width="100%" border="1" cellspacing="0" cellpadding="3" bgcolor="#CCCCCC"> <tr> <td>ID</td> <td>Title</td> <td>FileName</td> <td>大小</td> <td>尺寸</td> <td>类别</td> </tr> <% TurnPageFS(DefRecordNum) Rs.Close Set Rs=Nothing conn.Close Set conn=Nothing %> </table> <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="#E2F5FE"> <tr align="center"> <td colspan="2"><%Response.Write CurPageNum&"/"&TotalPages&"页 总记录数:"&TotalRecords%></td> <td><a href="mllist.asp">首页</a> <a href=javascript:turnpage('back');>上一页</a> <a href=javascript:turnpage('next');>下一页</a> </td> </tr> </table> <% EndTime=Timer Response.Write "<br>程序执行时间:"&(EndTime-BeginTime)*1000&"毫秒" Response.Write " 第一条记录的ID值(CursorBegin)="&CursorBegin&" " Response.Write "最后一条记录的ID值(CursorEnd)="&CursorEnd&"<br><br>" %> <script language="javascript"> function turnpage(func){ var CurPageNum=<%=CurPageNum%>; //取得当前页码 var CursorBegin=<%=CursorBegin%>; //取得第一个显示的记录的ID值 var CursorEnd=<%=CursorEnd%>; //取得最后一个显示的记录的ID值 var TotalPages=<%=TotalPages%>; //取得页面总数 var BackUrl='mllist.asp?CurPageNum='+(CurPageNum-1)+'&CursorBegin='+CursorBegin+'&CursorEnd='+CursorEnd+'&hav=back'; var NextUrl='mllist.asp?CurPageNum='+(CurPageNum+1)+'&CursorBegin='+CursorBegin+'&CursorEnd='+CursorEnd+'&hav=next'; if(CurPageNum<=1 && func=='back'){ location.href='#'; }else if(CurPageNum>=TotalPages && func=='next'){ location.href='#'; }else if(func=='back'){ location.href=BackUrl; }else if(func='next'){ location.href=NextUrl; } } </script> </body> </html> Cnbruce的代码: 分页样例:[首页] [上页] [下页] [尾页] [页次:4/5页] [共86篇 20篇/页] 转到:_ 页 以下为公用代码,必须具备。 <%filepath=request.servervariables("path_info")%> <%page=1 '设置变量初始值PAGE=1 page=request.querystring("page") 'page值为接受值 rs.PageSize = 20 '每页显示记录数 if Not IsEmpty(trim(Request("Page"))) then '如果PAGE已经初始化... Page = CInt(Request("Page")) '接收PAGE并化为数字型赋给PAGE变量 if Page > rs.PageCount then '如果接收的页数大于总页数 rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后页 elseif Page <= 0 then '如果page小于等于0 Page = 1 '设置PAGE等于第一页 else rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数 end if End if Page = rs.AbsolutePage%> 第一种分页 <%if rs.pagecount<>1 and rs.pagecount<>0 then%>'首先判断页总数不为1和0 <%if page>1 then%> <%if page<rs.pagecount then %> [<a Href="<%=filepath%>?Page=<% = 1%>">首页</a>] [<a Href="<%=filepath%>?Page=<% = page -1 %>">上一页</a>] [<a Href="<%=filepath%>?Page=<% = page + 1%>">下一页</a>] [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">尾页</a>] <%else%> [<a Href="<%=filepath%>?Page=<% = 1%>">首页</a>] [<a Href="<%=filepath%>?Page=<% = page -1 %>">上一页</a>] [下一页] [尾页] <% end if %> <%else%> [首页] [上一页] [<a Href="<%=filepath%>?Page=<% = page + 1%>">下一页</a>] [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">尾页</a>] <%end if %> <%else%> [首页] [上一页] [下一页] [尾页] <%end if%> 第二种分页 <%if rs.pagecount<>1 and rs.pagecount<>0 then%> <%if page>1 then%> [<a Href="<%=filepath%>?Page=<% = 1%>">首页</a>] [<a Href="<%=filepath%>?Page=<% = page -1 %>">上一页</a>] <%if page<rs.pagecount then %> [<a Href="<%=filepath%>?Page=<% = page + 1%>">下一页</a>] [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">尾页</a>] <%else%> [下一页] [尾页] <% end if %> <%else%> [首页] [上一页] [<a Href="<%=filepath%>?Page=<% = page + 1%>">下一页</a>] [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">尾页</a>] <%end if %> <%else%> [首页] [上一页] [下一页] [尾页] <%end if%> 第三种 <%if rs.pagecount<>1 and rs.pagecount<>0 then%> <%if page<rs.pagecount then%> <%if page=1 then %> [首页] [上一页] <%else%> [<a Href="<%=filepath%>?Page=<% = 1%>">首页</a>] [<a Href="<%=filepath%>?Page=<% =page -1 %>">上一页</a>] <% end if %> [<a Href="<%=filepath%>?Page=<% = page + 1%>">下一页</a>] [<a Href="<%=filepath%>?Page=<% = rs.PageCount%>">尾页</a>] <%else%> [<a Href="<%=filepath%>?Page=<% = 1%>">首页</a>] [<a Href="<%=filepath%>?Page=<% =page -1 %>">上一页</a>] [下一页] [尾页] <%end if %> <%else%> [首页] [上一页] [下一页] [尾页] <%end if%>
󰈣󰈤
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

网络安全治理:国家安全保障的主要方向是打击犯罪,而不是处置和惩罚受害者

来源:中国青年报 新的攻击方法不断涌现,黑客几乎永远占据网络攻击的上风,我们不可能通过技术手段杜绝网络攻击。国家安全保障的主要方向是打击犯罪,而不是处置和惩罚...

 
 
 
>>返回首页<<
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 
 热帖排行
 
纯美的她_仔婷
苏州河畔_秀气女生
痞子的甘南日记
疑是银河落九天
 
 
王朝网络微信公众号
微信扫码关注本站公众号wangchaonetcn
 
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
©2005- 王朝网络 版权所有