<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>测试分页</title>
</head>
<body>
<%
dim all, cnt, page, dig
dig = 10 ‘’ 每页显示条目
all = 100 ‘’ 总共的显示条目
cnt = 1
page = Request.QueryString("page")
pagenum = all/dig
Response.Write("pagenum = "&pagenum&"<br>page = "&page&"<br>")
%><hr>
<%
cnt = 1
do until cnt > all
if cnt>(page-1)*dig and cnt<=page*dig then
Response.Write("cnt = "&cnt & "<br>")
Response.Write("")
end if
cnt = cnt + 1
loop
‘’ 处理下一页
if (page-pagenum)=0 then
‘’if page=pagenum then 这样是不行滴,简直是搞笑嘛
nxt = "<td align=center>已抵达最后一页</td>"
else
nxt = "<td><div align=center><a href=testPage2.asp?page="&(page+1)&">下一页</a></div></td>"
end if
‘’ 处理上一页
if page>1 then
bck = "<td><div align=center><a href=testPage2.asp?page="&(page-1)&">上一页</a></div></td>"
end if
%><hr>
<table width="38%" border="1" cellspacing="0" cellpadding="0" align="right">
<tr>
<td><div align="center"><a href="testPage2.asp?page=1">首页</a></div></td>
<%=bck%>
<%=nxt%>
</tr>
</table></body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>测试分页</title>
</head>
<body>
<%
dim all, cnt, page, dig
dig = 10 ‘’ 每页显示条目
all = 100 ‘’ 总共的显示条目
cnt = 1
page = Request.QueryString("page")
pagenum = all/dig
Response.Write("pagenum = "&pagenum&"<br>page = "&page&"<br>")
%><hr>
<%
cnt = 1
do until cnt > all
if cnt>(page-1)*dig and cnt<=page*dig then
Response.Write("cnt = "&cnt & "<br>")
Response.Write("")
end if
cnt = cnt + 1
loop
‘’ 处理下一页
if (page-pagenum)=0 then
‘’if page=pagenum then 这样是不行滴,简直是搞笑嘛
nxt = "<td align=center>已抵达最后一页</td>"
else
nxt = "<td><div align=center><a href=testPage2.asp?page="&(page+1)&">下一页</a></div></td>"
end if
‘’ 处理上一页
if page>1 then
bck = "<td><div align=center><a href=testPage2.asp?page="&(page-1)&">上一页</a></div></td>"
end if
%><hr>
<table width="38%" border="1" cellspacing="0" cellpadding="0" align="right">
<tr>
<td><div align="center"><a href="testPage2.asp?page=1">首页</a></div></td>
<%=bck%>
<%=nxt%>
</tr>
</table></body>
</html>