错误这是一个简单的测试分页的程序,代码如下:
<%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&"
page = "&page&"
")
%><hr>
<%
cnt = 1
do until cnt > all
if cnt>(page-1)*dig and cnt<=page*dig then
Response.Write("cnt = "&cnt & "
")
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>
ASP 莫名其妙的错误
80酷酷网 80kuku.com