简便的ASP上十页,下十页分页程序
需求实现简单的分页管理数据的页面功能,类似下面采用物理分页方式:即每打开一页都交互从后台取回需要页数据同时也有逻辑分页方式,就是一次交互<%sql="select*fromhrorderbyiddesc"setrs=server.CreateObject("adodb.recordset")rs.opensql,conn,1,1ifrs.eofthen%>暂无内容芜湖网站建设www.wh0553.cn<%elseshownum=12totalrecord=rs.recordcountrs.pagesize=shownummaxpage=rs.pagecountrequestpage=clng(request.querystring("page"))ifrequestpage=""orrequestpage=0thenrequestpage=1endififresquestpage>maxpagethenresquestpage=maxpageendififnotrequestpage=1thenrs.move(requestpage-1)*rs.pagesizeendiffori=1tors.pagesizeandnotrs.bof%>显示内容新闻列表<%rs.movenextifrs.eofthenexitfornext%><%ifrequestpage-1mod10=0thenp=(requestpage-1)\10elsep=(requestpage-1)\10endififrequestpage=1thenresponse.write"9"elseresponse.write"9"endififp*10>0thenresponse.write"7"response.write""forii=p*10+1toP*10+10ifii=requestpagethenresponse.write""&ii&""elseresponse.write""&ii&""endififii=maxpagethenexitfornextresponse.write""ifii8"ifrequestpage=maxpagethenresponse.write":"elseresponse.write":"endifresponse.write"总共有"&maxpage&"页共"&totalrecord&"个记录每页"&shownum&"个"%><%endif%>。
2019/9/7