asp完美分页代码

<%
rs.PageSize = 翻页数    
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1
pre = true
last = true
page = trim(Request.QueryString("page"))   
if len(page) = 0 then
    intpage = 1
    pre = false
else
    if cint(page) =< 1 then
        intpage = 1
        pre = false
    else
            if cint(page) >= rs.PageCount then
                intpage = rs.PageCount
                last = false
            else
                intpage = cint(page)
            end if
    end if
end if
if not rs.eof then
    rs.AbsolutePage = intpage
end if
%>

 


<table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="37%" align="center" bgcolor="#EFF7FF">
              <%if rs.pagecount > 0 then%>
              当前页<%=intpage%>/<%=rs.PageCount%>
              <%else%>
              当前页0/0
              <%end if%></td>
              <td width="12%" bgcolor="#EFF7FF"><a href="Manage_product.asp?page=1">第一页</a></td>
              <%if pre then%>
              <td width="7%" bgcolor="#EFF7FF"><a href="Manage_product.asp?page=<%=intpage -1%>">上页</a>
                <%end if%></td><%if last then%>
              <td width="10%" bgcolor="#EFF7FF"><a href="Manage_product.asp?page=<%=intpage +1%>">下页</a></td>
              <%end if%>
              <td width="10%" bgcolor="#EFF7FF"><a href="Manage_product.asp?page=<%=rs.PageCount%>">尾页</a></td>
              <td width="24%" align="right" bgcolor="#EFF7FF">转到第
      <select name="sel_page" onChange="javascript:location=this.options[this.selectedIndex].value;">
      <%
       for i = 1 to rs.PageCount
       if i = intpage then%>
       <option value="Manage_product.asp?page=<%=i%>" selected><%=i%></option>
      <%else%>
       <option value="Manage_product.asp?page=<%=i%>"><%=i%></option>
      <%
      end if
      next
      %>
     </select>页</font></td>
            </tr>
          </table>

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值