ASP

本类阅读TOP10

·asp常用数据库连接方法和技巧
·无组件生成BMP验证码
·一些常用的辅助代码 (网络收藏)
·JavaScript实现的数据表格:冻结列、调整列宽和客户端排序
·VisualStudio.NET_2003及其 MSDN 下载地址
·ASP模拟MVC模式编程
·图片以二进制流输出到网页
·MD5加密算法 ASP版
·ASP.NET编程中的十大技巧
·改进 ASP 的字符串处理性能

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
再强推一分页方法(应用的时候,曾出现一个小问题,不过调试好后,大笑三声)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

       <table border="0" height="51" width="100%">
     <%
     id=request("t_id")
    
  set rs=server.createobject("adodb.recordset")
          sql="select * from news where news_type="&id&" order by news_id desc"
          rs.open sql,conn,1,1
        
        rs.pagesize=20
  currentpage=Clng(request("page"))
  if currentpage<1 then currentpage=1
  if currentpage>rs.pagecount then currentpage=rs.pagecount
  rs.absolutepage=currentpage
  %>
  <% do while not rs.eof %>
   <tr>
    <td width="94" height="25"><font color="#b8b8b8"><% =rs("news_date")%></font></td>
   </tr>
   <%
   i=i+1
   rs.movenext
   if i>=rs.pagesize then exit do
   loop
   %>
  </table><br>
       <div align="center">
           <table width="100%" border="0" cellpadding="0" cellspacing="0" height="34">
                    <tr>
                      <td width="100%" height="23">
                         <p align="center">&nbsp;总 <font color=red><% =rs.recordcount%></font>
       条记录 每页显示 <%=rs.pagesize%> 条 第 <%=currentpage%>
                          页/共 <%=rs.pagecount%> 页&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          <%if currentpage>1 then%>
                          <font color=666666><a href="zhixun_more.asp?t_id=<% =id%>&page=1" class="a2">
       首 页 </a>
                          <a href="zhixun_more.asp?t_id=<%=id%>&page=<%=currentpage-1%>" class="a2">
       上一页</a></font>
                          <%else%>首 页 上一页 <%end if%>
                          <%if currentpage <rs.pagecount then%> 
                          <font color=666666><a href="zhixun_more.asp?t_id=<%=id%>&page=<%=currentpage+1%>" class="a2">
       下一页</a>
                          <a href="zhixun_more.asp?t_id=<%=id%>&page=<%=rs.pagecount%>" class="a2">
       末 页</a>
                          <%else%>下一页 末 页<%end if%>&nbsp; </font></p></td>
                     </tr></table>
          </div>
       <% rs.close %>



相关文章

相关软件