ASP分页问题,老是出错,真想不通,高手看看。。。
zpwsz 2003-12-13 11:48:56 页面http://17flying.net/web/type.asp,在本地测试时,不管怎么改,第二页老是从第十一条信息开始,也不知怎么回事,改了都没用,页面的源文件http://www.17flying.net/web/type_2.txt,高手看看呀,关键代码:
--------------------------
<%
const MaxPrePage=10 '每页显示记录数
if (request.querystring("page")<>"") and (IsNumeric(request.querystring("page"))) then '检查页号
intPage=CLng(request.querystring("page"))
else
intPage=1
end if
strSql="select * from zkpick where picktype="&CLng(request.querystring("type"))
if (request.querystring("type")<>"") and (IsNumeric(request.querystring("type"))) then '检查是否等级分类
inttype=CLng(request.querystring("type"))
strSql=strSql& " and picktype="&CLng(request.querystring("type"))
else
strSql="select * from zkpick"
end if
strSql=strSql&" order by pickvisitor desc,pickvote desc,pickid desc"
%>
<%
Sub DisplayPagelinks(rs,intPage,intType) '页面导航条
if not(request.querystring("type")<>"") and (IsNumeric(request.querystring("type"))) then
response.write " 全部网站 共有"&rs.RecordCount&"个 "
else
response.write " "&typestr&" 共有"&rs.RecordCount&"个"
end if
if intPage>1 then
if intType<>0 then
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page=1""><font color='#666666'>首页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page="&intPage-1&"""><font color='#666666'>上一页</font></a> "
else
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page=1""><font color='#666666'>首页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page="&intPage-1&"""><font color='#666666'>上一页</font></a> "
end if
else
response.write "首页 "
response.write "上一页 "
end if
if intPage < rs.PageCount then
if intType<>0 then
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page="&intPage+1&"""><font color='#666666'>下一页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?type="&intType&"&page="&rs.PageCount&"""><font color='#666666'>尾页</font></a> "
else
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page="&intPage+1&"""><font color='#666666'>下一页</font></a> "
response.write "<a href="""&request.ServerVariables("SCRIPT_NAME")&"?page="&rs.PageCount&"""><font color='#666666'>尾页</font></a> "
end if
else
response.write "下一页 "
response.write "尾页 "
end if
'-------------------------------
End Sub
%>