CNET中国旗舰网站

ZDNet China | CNET科技资讯网 | 政府采购 | 行业网站联盟





 
标题: [转贴] 我的分页功能怎么分不了页?
mz89757053
版主
Rank: 7Rank: 7Rank: 7


UID 304999
精华 0
积分 6933
帖子 8295
威望 116
ZD币 1002 元
阅读权限 250
注册 2008-3-10
状态 离线
  楼主
发表于 2008-4-23 13:16  资料  个人空间  短消息  加为好友 
开发者在线

我的分页功能怎么分不了页?

//运行时只显示第一页,点其它页它不是显示第一页   
  <%@LANGUAGE="VBSCRIPT"   CODEPAGE="936"%>   
  <!--#include   file="connections/myconn.asp"-->   
  <%   
  Dim   pg   
  pg=Trim(Request("page"))   
  if   pg=""   then     
        Pg=1   
  End   if   
   
  %>   
  <%   
  Dim   rs1,numrow_page   ,rs1Count   
  Set   rs1=server.createobject("adodb.recordset")   
  rs1.ActiveConnection=MM_myconn_STRING   
  rs1.CursorType=3   
  rs1.LockType=1   
  numrow_page=5       '每页5条   
  rs1.Source="select   *   from   treeview"   
  rs1.PageSize=5           '每页5条记录   
  rs1.Open()   
  rs1.AbsolutePage=pg   
  'rs1Count=rs1.RecordCount   
  %>   
   
  <!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
  <html   xmlns="http://www.w3.org/1999/xhtml">   
  <head>   
  <meta   http-equiv="Content-Type"   c   />   
  <title>无标题文档</title>   
  </head>   
   
  <body>   
  <table   border="1">   
      <tr>   
          <td>ID</td>   
          <td>parentId</td>   
          <td>nodetext</td>   
          <td>hint</td>   
          <td>icon</td>   
          <td>data</td>   
          <td>url</td>   
          <td>target</td>   
          <td>method</td>   
      </tr>   
      <%   
      numrow_page=0   
      while   (numrow_page<rs1.PageSize)   and   (not   rs1.eof)   
      %>   
      <tr>   
          <td><%=(rs1.Fields.Item("ID").Value)%></td>   
          <td><%=(rs1.Fields.Item("parentId").Value)%></td>   
          <td><%=(rs1.Fields.Item("nodetext").Value)%></td>   
          <td><%=(rs1.Fields.Item("hint").Value)%></td>   
          <td><%=(rs1.Fields.Item("icon").Value)%></td>   
          <td><%=(rs1.Fields.Item("data").Value)%></td>   
          <td><%=(rs1.Fields.Item("url").Value)%></td>   
          <td><%=(rs1.Fields.Item("target").Value)%></td>   
          <td><%=(rs1.Fields.Item("method").Value)%></td>   
      </tr>   
      <%   
      numrow_page=numrow_page+1   
      rs1.movenext   
      Wend   
      %>   
  </table>   
  <hr   size="2"   />   
  <b>Go   to   Page:</b>   
  <%   
  Dim   i   
  if   rs1.pagecount>1   then   
    for   i=1   to   rs1.pagecount   
      if   i<>cint(pg)   then   
  %>   
  <a   href="test.asp?pg=<%=i%>"><%=i%></a>   
  <%else   %>   
  <b><%=i%></b>   
  <%end   if   
  Next   
  end   if   
  %>   
  </body>   
  </html>




顶部
热点频道推荐: C/S开发| 数据库| WEB开发| 嵌入式| 项目管理|
 



当前时区 GMT+8, 现在时间是 2009-7-4 16:51

  Powered by Discuz! 5.5.0 © 2001-2007 Comsenz Inc.
Processed in 0.059338 second(s), 3/3 queries

清除 Cookies - 联系我们 - ZDNetChina中文社区 - 无图版