一个简单ASP分页

发布时间:2013-09-19 11:33:46来源:阅读(1549)

    <% mypage=request("page")
         If  mypage="" then
           mypage=1
         end if
         rs.open "......",conn,1,1
       if rs.eof or rs.bof then
       response.write"

    尚无内容!

    "
       else
       rs.pagesize=15
       g_count=rs.recordcount
       maxpages=cint(rs.pagecount)
       maxrecs=cint(rs.pagesize)
       rs.absolutepage=mypage
       howmanyrecs=0
       rec = 1
       do until rs.eof or rs.bof or rec=16 %>

     

    <% rs.movenext
        rec=rec+1
        loop
        end if
        scriptname=request.servervariables("script_name")
        rs.close%>

     

    <%if maxpages > 1 then%>
      


               
              共[<%= g_count %>]条信息  每页[<%= maxrecs %>]条  共[<%= maxpages %>]页
        <% if cint(mypage)<>1 then %><% End If %>首页<% if cint(mypage)<>1 then %><% End If %> 
        <% if cint(mypage)>1 then %><% End If %>上页<% if cint(mypage)>1 then %><% End If %> 
        <% if cint(mypage)<% End If %>下页<% if cint(mypage)<% End If %> 
        <% if cint(mypage)<>maxpages then %><% End If %>尾页<% if cint(mypage)<>maxpages then %><% End If %>
        页次跳转:
       
            <% end if %>

     

    如有不好不对的地方,请大家指正,谢谢.

关键字