非常SOS!!ASP分页问题,高分急寻!
zpwsz 2003-12-15 04:30:42 页面http://17flying.net/web/type.asp,在本地测试时,MaxPrePage=10中的10不管改为几,第二页都是从第十一条信息开始,这是怎么回事呀,页面的源文件http://www.17flying.net/web/type_2.txt,不知是不是SQL语句出错了,还是其它问题,小弟是刚学ASP的,现在又要得急,贴在ASP版的几天http://expert.csdn.net/Expert/topic/2561/2561341.xml?temp=.9012873,还是没人给出正确结果,实在没有办法,只好再贴一次!
本着助人精神的高手们,帮小弟看看呀,源文件到底是错在哪??如果需要全站文件可发E到seezoo@17flying.net或QQ8041983。万分致谢!
关键代码:
------------------------------------------
<%
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 picktype2="&CLng(request.querystring("type"))
if (request.querystring("type")<>"") and (IsNumeric(request.querystring("type"))) then '检查是否等级分类
inttype=CLng(request.querystring("type"))
strSql=strSql& " and picktype2="&CLng(request.querystring("type"))
else
strSql="select * from zkpick"
end if
strSql=strSql&" order by 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
%>