asp中"无限流"分页程序代码(3)
&" 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%>; //取得页面总数
内容版权声明:除非注明,否则皆为本站原创文章。