我跟个通用分页 :) 大家修改一点都可以用. 简单修改可以用了。<%'SQL语句自己设置sql="select * from table order by id desc" Set rs= Server.CreateObject("ADODB.Recordset") rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "<p align='center'> 还 没 有 任 何 文 章 </p>" else totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showpage totalput,MaxPerPage,"manage.asp" showContent showpage totalput,MaxPerPage,"manage.asp" else if (currentPage-1)*MaxPerPage<totalPut then rs.move (currentPage-1)*MaxPerPage showpage totalput,MaxPerPage,"manage.asp"'文件名字简单修改 showContent showpage totalput,MaxPerPage,"manage.asp" else currentPage=1 showpage totalput,MaxPerPage,"manage.asp" showContent showpage totalput,MaxPerPage,"manage.asp" end if end if rs.close end if set rs=nothing conn.close set conn=nothing%><%'下面是显示内容部分 sub showContent dim i i=0%><!--你的内容显示部分--><% i=i+1 if i>=MaxPerPage then exit do rs.movenext loopend sub%><%'页码function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if response.write "<p align='center'> " if CurrentPage<2 then response.write "<font color='#000080'>首页 上一页</font> " else response.write "<a href="&filename&"?page=1&txtitle="&title&">首页</a> " response.write "<a href="&filename&"?page="&CurrentPage-1&"&txtitle="&title&">上一页</a> " end if if n-currentpage<1 then response.write "<font color='#000080'>下一页 尾页</font>" else response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&txtitle="&title&">" response.write "下一页</a> <a href="&filename&"?page="&n&"&txtitle="&title&">尾页</a>" end if response.write "<font color='#000080'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> " response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>个文档 <b>"&maxperpage&"</b>个文档/页</font> " end function%>http://www.programfan.com/club/

评论