当前位置:编程学习 > asp >>

一款asp分页程序(支持跳转与输入数字)

一款asp教程分页程序(支持跳转与输入数字)

sub pcfinal_page
    action = "http://" & request.servervariables("http_host") & request.servervariables("script_name")
    query = split(request.servervariables("query_string"), "&")
    for each x in query
        a = split(x, "=")
        if strcomp(a(0), "page", vbtextcompare) <> 0 then
            temp = temp & a(0) & "=" & a(1) & "&"
        end if
    next
    response.write("<br/><table class='table'><form method='get' onsubmit=""document.location = '"&action&"?"&temp&"page='+ this.page.value;return false;""><tr><td align='center'>")
    if page<= 1 then
        response.write ("首页 上一页 ")
    else
        response.write("<a href='"&action&"?"&temp&"page=1'>首页</a> <a href='"&action&"?"&temp&"page="&(page -1)&"'>上一页</a> ")
    end if
    if page>= maxpage then
        response.write ("下一页 尾页 ")
    else
        response.write("<a href='"&action&"?"&temp&"page="&(page+1)&"'>下一页</a> <a href='"&action&"?"&temp&"page="&maxpage&"'>尾页</a> ")
    end if
    response.write("["&page&"/"&maxpage&"页] [共"&allpage&"条记录] 转到第 <input type='text' name='page' size='3' value='"&page&"'> 页 <input type='submit' value='跳转'/></td></tr></form></table>")
end sub
%>
补充:asp教程,ASP入门 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,