asp最常用的分页函数(5)
<%
dim b
if totalnumber mod maxperpage=0 then
b=totalnumber\maxperpage
else
b=totalnumber\maxperpage+1
end if
%>
<div align="center">共有<%=totalnumber%>/<%=maxperpage%>条,
当前页<%=currentpage%>/<%=b%>
<%
dxystart=currentpage-5
if dxystart<1 then dxystart=1
dxyend=currentpage+5
if dxyend>b then dxyend=b
for dxy=dxystart to dxyend
if dxy=currentpage then
response.write "[<a href="&filename&"&page="&dxy&">"&"<font color=red>"&dxy&"</font>"&"</a>]"&" "
else
response.write "[<a href="&filename&"&page="&dxy&">"&dxy&"</font>"&"</a>]"&" "
end if
next
%>
</div> </td>
</tr>
<%
end function
%>
</form>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>