加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

ASP中最常用的分页功能

发布时间:2023-05-29 14:01:41 所属栏目:Asp教程 来源:
导读:复制代码 代码如下:

rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align=&#39;center&#39;>还没找到文章</p>"
else
totalPut=rs.recordcount
maxperpage=18
复制代码 代码如下:

    rs.open sql,conn,1,1
    if rs.eof and rs.bof then
     response.write "<p align='center'>还没找到文章</p>"
  else
   totalPut=rs.recordcount
   maxperpage=18
   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
    showpage1 totalput,maxperpage,"infotype.asp?id="&request("id")
    showcontent()
    showpage totalput,maxperpage,"infotype.asp?id="&request("id")
    else
       if (currentpage-1)*maxperpage<totalput then
       rs.move (currentpage-1)*maxperpage
       dim bookmark
       bookmark=rs.bookmark
       showpage1 totalput,maxperpage,"infotype.asp?id="&request("id")
       showcontent
       showpage totalput,maxperpage,"infotype.asp?id="&request("id")
       else
       currentpage=1
       showpage1 totalput,maxperpage,"infotype.asp?id="&request("id")
       showcontent
       showpage totalput,maxperpage,"infotype.asp?id="&request("id")
       end if
    end if 
end if
%>
<%
  sub showcontent()
  %>
  <tr>
    <td height="20" class="blueback2"><div align="center">ID</div></td>
    <td class="blueback2"><div align="center"><a href="javascript:selectall()"><font color="#FFFFFF">选择</font></a></div></td>
    <td width="355" class="blueback2"><div align="center">信息标题</div></td>
    <td width="84" class="blueback2"><div align="center">更新日期</div></td>
    <td width="40" class="blueback2"><div align="center">点击</div></td>
    <td width="55" class="blueback2"><div align="center">添加人</div></td>
    <td width="44" class="blueback2"><div align="center">编辑</div></td>
    <td width="43" class="blueback2"><div align="center">删除</div></td>
    <td width="62" class="blueback2"><div align="center">生成[<a href="javascript:void(null)" onClick="window.open('cshengcheng.asp','','width=0,height=0')"><font color="#FFFFFF">归零</font></a>]</div></td>
  </tr>  
  <%

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章