• 分页分页!!


    不足之处请大家指正!:)
    dim rs,sql,key,strsql,page,i,x
    key=request("key") '搜索关键字
    strsql="?key="&key
    page=cint(request("page"))
    if page="" or page<=0 or isnumeric(page)=false then page=1
    set rs=.....
    sql="..... where .. like'%"%key&"%' or ... like'%"&key&"%'...."
    rs.open sql......
    if not rs.eof then
    rs.movefirst
    .....
    i=0
    do while not rs.eof and i<rs.pagesize
    i=i+1
    .........
    .......
    .....
    ..
    rs.movenext
    loop
    else
    page=0
    end if
    response.Write("共计"&rs.recordcount&"条&nbsp;")
    response.Write("每页"&rs.pagesize&"条&nbsp;")            
    response.Write("第"&page&"/"&rs.pagecount&"页&nbsp;")
    if page>1 and page<=rs.pagecount then response.Write("<a href="&strurl&"&page="&page-1&" class=l9>上一页</a>&nbsp;")
    if page<rs.pagecount and rs.pagecount>1 then response.Write("<a href="&strurl&"&page="&page+1&" class=l9>下一页</a>")
    if rs.pagecount>1 then    
    response.Write("&nbsp;转到第<select onchange='javascript:location.href=this.options[selectedIndex].value'>")
    for x=1 to rs.pagecount
    if cint(page)=x then
    response.Write("<option value="&strurl&"&page="&x&" selected>"&x&"</option>")
    else
    response.Write("<option value="&strurl&"&page="&x&">"&x&"</option>")
    end if
    next
    response.Write("</select>页")
    end if
    rs.close
    set rs=nothing
    conn.close
    set conn=nothing
  • 相关阅读:
    oracle中xhost报错
    cronolog切割apache和tomcat日志
    rsync配置和同步数据
    Jenkins+GitHub+maven
    Git只获取部分目录的内容
    git命令综合
    tomcat(不仅仅是tomcat)通过熵池解决在linux启动应用慢
    iptables之ipset集群工具
    Python中yield表达式的使用
    对于python中出现UnicodeDecodeError问题的解决方案
  • 原文地址:https://www.cnblogs.com/QDuck/p/253806.html
Copyright © 2020-2023  润新知