文跃's profile难得糊涂PhotosBlogLists Tools Help

Blog


    November 27

    asp 分页

    <!-- **** 翻页的ASP标准代码: pages.inc ****-->
    <!-- Existing connection name: "conn" -->
    <%
    rs.pagesize = 20
    pageno = trim(request("pageno"))
    s_type_chanel=request("s_type_chanel")
    if isnumeric(pageno) then
        pageno = clng(pageno)
        if pageno < 1 or pageno > rs.pagecount then
            pageno = 1
        end if
        session("pageno") = pageno
    else
        if isEmpty(session("pageno")) or session("pageno")="" then
            pageno = 1
        else
            pageno = session("pageno")
        end if
    end if
    if rs.recordcount > 0 then rs.absolutepage = pageno

    ' ------------ 显示翻页按钮函数 --------------
    Sub ShowPageNavigator(pageno,despage)
     if CLng(pageno) <= 1 then
      dFirst = "disabled"
      dPrev = "disabled"
     end if
     
     if CLng(pageno) >= rs.pagecount then
      dNext = "disabled"
      dLast = "disabled"
     end if
     
    %>
    <center>
    <form id="getpages" name="getpages" method="post" action="<%=despage%>">
    <%
    response.write "<font class=black>第" & CStr(pageno) & "页/共" & CStr(rs.PageCount) & "页"
    response.write "(" & CStr(rs.RecordCount) & "条记录)"
    %>
     
    <%if CLng(pageno) <= 1 then%>
    <font class="black"><b><<</b>最前页</font>
    <%else%>
    <a href="<%=despage%>&pageno=1" class="black"><b><<</b>最前页</a>
    <%end if%>
    <%if CLng(pageno) <= 1 then%>
    <font class="black"><b><</b>上页</font>
    <%else%>
    <a href="<%=despage%>&pageno=<%=pageno-1%>" class="black"><b><</b>上页</a>
    <%end if%>
    <%if CLng(pageno) >= rs.pagecount then%>
    <font class="black">下页<b>></b></font>
    <%else%>
    <a href="<%=despage%>&pageno=<%=pageno+1%>" class="black">下页<b>></b></a>
    <%end if%>
    <%if CLng(pageno) >= rs.pagecount then%>
    <font class="black">最后页<b>>></b></font>
    <%else%>
    <a href="<%=despage%>&pageno=<%=rs.pagecount%>" class="black">最后页<b>>></b></a>
    <%end if%>
    &nbsp;
      <input name="pageno" type="text" size=3/>
      <input type="submit" name="Submit" value="跳转" />
    </form>
    </center>
    <%
    End Sub
    %>

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://wenyueb.spaces.live.com/blog/cns!ED01E7270578387F!201.trak
    Weblogs that reference this entry
    • None