请哪位高手帮我看一下我这个前十页后十页的分页程错在哪里?
现在的情况是,我每20条作一页,但现在显示的是:
第一页显示全部内容,第二页减掉20个,第三页又减掉20,这样的显示,而不是20个一页了.请高手指点!
实例请在这里
http://wind-love.com/newbbs/main.asp?bid=1_50&sid=1_50_15
程序是这样的:
<%
MMaxPerPage=20
rs.PageSize=MMaxPerPage
if trim(request("Page"))<>"" then
CurrentPage=CInt(request("Page"))
if CurrentPage>rs.PageCount then
CurrentPage=rs.PageCount
end if
else
CurrentPage=1
end if
if rs.EOF then
Response.Write "<center><font color=red>还没有贴子!</font>"
else
ttotalPut=rs.RecordCount
if CurrentPage<>1 then
if (CurrentPage-1)*MMaxPerPage<ttotalPut then
rs.Move(CurrentPage-1)*MMaxPerPage
bookmark=rs.Bookmark
end if
end if
end if
if (ttotalPut mod MMaxPerPage)=0 then
mm=ttotalPut\MMaxPerPage
else
mm=ttotalPut\MMaxPerPage+1
end if
if (ttotalPut mod (MMaxPerPage*10))=0 then
nn=ttotalPut\(MMaxPerPage*10)
else
nn=ttotalPut\(MMaxPerPage*10)+1
end if
%>
<%
if (CurrentPage mod 10)=0 then
kk=CurrentPage\10-1
else
kk=CurrentPage\10
end if
if nn>1 and CurrentPage>10 then
Response.Write "<b><a href='main.asp?bid="&request("bid")&"&sid="&request("sid")&"&page="+CStr((kk-1)*10+1)+"'>Previous</a></b>"
end if
for ii=1 to 10
jj=kk*10+ii
if jj<=mm then
if jj=CurrentPage then
Response.Write " <font color=red>"+CStr(jj)+"</font>"
else
Response.Write " <b>"+"<a href='main.asp?page="+CStr(jj)+"'>"+CStr(jj)+"</a></b>"
end if
end if
next
Response.Write " "
if kk<nn-1 then
Response.Write " <b>"+"<a href='main.asp?page="+CStr((kk+1)*10+1)+"'>Next</a></b>"
end if
k=0
for y=(page-1)*20+1 to (page-1)*20+20
do while not rs.EOF
if i mod 2 then
%>
<table width=98% border="0" height=20 cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td>内容</td>
</tr>
</table>
<%else%>
<table width=98% bgcolor=#DEE3F7 height=20 border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td>内容</td>
</tr></table>
<%end if
i=i+1
rs.MoveNext
loop
next
%>