system_rs_num是系统变量,设定每页显示多少条记录 list_rs 是纪录集
只要把displist.asp?class_id="&class_id&"替换对了,就绝对没有问题。
设定每页的纪录数量
<%list_rs.pagesize=system_rs_num
total=0
if not list_rs.eof then
total=list_rs.recordcount
end if%>
判断当前是哪页
<%if total>0 then
if total/system_rs_num>int(total/system_rs_num) then
totalpage=int(total/system_rs_num)+1
else
totalpage=int(total/system_rs_num)
end if
if page="" or isnull(page) then
list_rs.absolutepage=1
else
list_rs.absolutepage=cint(page)
end if
end if%>
。。。。。。。
页面记录显示
。。。。。。。
最多显示10页,如果再多就用 后十页前十页代替
<%if totalpage>0 then%>
<table width="<%=system_fbl*0.8%>" border="0" cellpadding="0" cellspacing="0" bordercolor="#89ACF5" style="border-collapse: collapse" height="21" background="images/lanmu.jpg">
<tr>
<td height="8" align="left" bgcolor="#FFFFFF" width="40%"> 共有记录<%=total%>条 每页<%=system_rs_num%>条记录 共<%=totalpage%>页</td>
<td height="8" align="right" bgcolor="#FFFFFF" width="60%">页次列示:
<%
if totalpage<=10 then
tmppage=1
do while tmppage<=totalpage
if tmppage=int(page) then
response.write " <font color='#FF0000'><b>"&tmppage&"</b></font>"
else
response.write " <a href='displist.asp?class_id="&class_id&"&page="&tmppage&"' ><b>"&tmppage&"</b></a>"
end if
tmppage=tmppage+1
loop
response.write " "
end if
if totalpage>10 then
zfjtmppage1=(int(page/10)-1)*10+1
if zfjtmppage1<1 then
zfjtmppage1=1
end if
zfjtmppage2=(int(page/10)+1)*10+1
if int(zfjtmppage2/10)>int(totalpage/10) then
if int(totalpage/10)=totalpage/10 then
zfjtmppage2=totalpage
else
zfjtmppage2=int(totalpage/10)*10+1
end if
end if
if int(page/10)>0 then
response.write "<a href='displist.asp?class_id="&class_id&"&page=1' title='到第一页看看'><b><font face=webdings>9</font></a>"
response.write "<a href='displist.asp?class_id="&class_id&"&page="&zfjtmppage1&"' title='到前面10页看看'><b><font face=webdings>7</font></a>"
else
response.write "<b><font face=webdings>9</font>"
response.write "<b><font face=webdings>7</font>"
end if
if int(page/10)=page/10 then
tmppage=(int(page/10)-1)*10+1
do while tmppage<=int(page/10)*10
if tmppage=int(page) then
response.write " <font color='#FF0000'><b>"&tmppage&"</b></font> "
else
response.write "<a href='displist.asp?class_id="&class_id&"&page="&tmppage&"' title='到第"&tmppage&"页看看'><b> "&tmppage&"</b></a>"
end if
tmppage=tmppage+1
loop
end if
if int(page/10)<>page/10 then
tmppage=int(page/10)*10+1
if int(page/10)=int(totalpage/10) then
do while tmppage<=totalpage
if tmppage=int(page) then
response.write " <font color='#FF0000'><b>"&tmppage&"</b></font>"
else
response.write "<a href='displist.asp?class_id="&class_id&"&page="&tmppage&"' title='到第"&tmppage&"页看看'><b> "&tmppage&"</b></a>"
end if
tmppage=tmppage+1
loop
end if
if int(page/10)<int(totalpage/10) then
do while tmppage<=(int(page/10)+1)*10
if tmppage=int(page) then
response.write " <font color='#FF0000'><b>"&tmppage&"</b></font>"
else
response.write "<a href='displist.asp?class_id="&class_id&"&page="&tmppage&"' title='到第"&tmppage&"页看看'><b> "&tmppage&"</b></a>"
end if
tmppage=tmppage+1
loop
end if
end if
if int(page/10)=page/10 then
if int(page/10)>int(totalpage/10) then
response.write "<b><font face=webdings>8</font>"
response.write "<b><font face=webdings>:</font> "
else
response.write "<a href='displist.asp?class_id="&class_id&"&page="&zfjtmppage2&"' title='到后面10页看看'><b><font face=webdings>8</font></a>"
response.write "<a href='displist.asp?class_id="&class_id&"&page="&totalpage&"' title='到最后一页看看'><b><font face=webdings>:</font></a> "
end if
else
if int(page/10)>=int(totalpage/10) then
response.write "<b><font face=webdings>8</font>"
response.write "<b><font face=webdings>:</font> "
else
response.write "<a href='displist.asp?class_id="&class_id&"&page="&zfjtmppage2&"' title='到后面10页看看'><b><font face=webdings>8</font></a>"
response.write "<a href='displist.asp?class_id="&class_id&"&page="&totalpage&"' title='到最后一页看看'><b><font face=webdings>:</font></a> "
end if
end if
end if%>
</td>
</tr>
</table>
<% end if%>