• asp数据分页显示技术(上下页版)


    <%set rs=server.CreateObject("adodb.recordset")
    sql="select * from [student_admin] order by id DESC"
    rs.open sql,conn,1,3
    %>
    <%
    rs.pagesize=15'这个是显示最新的8条记录,可以按自己需要改
    curpage=Request.QueryString("curpage")'记录页码数
    if curpage="" then curpage=1'如果为空就让它为1,不可能要它0页嘛
    if rs.bof and rs.eof then'判断数据库有没有记录,没有就下面
    response.Write("")
    else
    rs.AbsolutePage=curpage '记录当前页码
    for i= 1 to rs.pagesize'循环,从1到当前页码
    if rs.eof then'如果到最后一条记录,退出循环
    exit for
    end if
    %>
    内容......................................
    <%
    rs.movenext
    if rs.eof then
    exit for
    end if
    next
    %>
    <div align="center" class="STYLE4" style="height:35px; padding-top:10px">
    共有<%=rs.pagecount%>页,当前第<%=curpage%>页
    <%if curpage=1 then%>首页<%else%><a href="?curpage=1">首页</a><%end if%>
    <%if curpage<>1 then%><a href="?curpage=<%=curpage-1%>">上一页</a><%end if%>
    <%if rs.pagecount>=curpage+1 then%><a href="?curpage=<%=curpage+1%>">下一页</a><%end if%>
    <%if rs.pagecount<curpage+1 then%>尾页<%else%><a href="?curpage=<%=rs.pagecount%>">尾页</a><%end if%>
    </div>

  • 相关阅读:
    mysql性能分析工具
    vim使用大全
    Vue computed属性
    模板题 + KMP + 求最小循环节 --- HDU 3746 Cyclic Nacklace
    Greedy --- HNU 13320 Please, go first
    DFS --- HNU 13307 Galaxy collision
    HNU 13308 Help cupid
    Linux
    dp
    2015 Multi-University Training Contest 2 1006 Friends
  • 原文地址:https://www.cnblogs.com/ince/p/9154822.html
Copyright © 2020-2023  润新知