asp

位置:IT落伍者 >> asp >> 浏览文章

一个实用asp分页函数


发布日期:2021年01月11日
 
一个实用asp分页函数

分享一个asp分页函数感觉挺好看的视图如图


可以根据自己的情况修改代码

<%
谢亮修分页程序
call pagecontrol(记录总数页码总数当前页)
Sub PageControl(iCountpagecountpage)
responseWrite("<style type=""text/css"">/*谢亮分页CSS*/divpager{padding:px;}divpager adivpager span{padding:px px;margin:px;fontfamily:""宋体"";border:px # solid;}divpager a {textdecoration:none}divpager a:hover {color:#;backgroundcolor:#}divpager spancurrent {fontweight:bold;color:#fff;backgroundcolor:#}divpager spandisabled {border:px #ccc solid;}</style>") &chr()
Dim query a x temp
action = "http://" & RequestServerVariables("HTTP_HOST") & RequestServerVariables("SCRIPT_NAME")
query = Split(RequestServerVariables("QUERY_STRING") "&")
For Each x In query
a = Split(x "=")
If StrComp(a() "page" vbTextCompare) <> Then
temp = temp & a() & "=" & a() & "&"
End If
Next
responseWrite("<div class=""pager"">")&chr()
ResponseWrite("<span class=""disabled"">" & page & "/" & pageCount & "页</span>")&chr()
ResponseWrite("<span class=""disabled"">共" & iCount & "条记录</span>")&chr()
if pagecount<= then
for xl= to pagecount
if page=xl then
responseWrite("<span class=current>"&xl&"</span>")&chr()
else
ResponseWrite("<a " & action & "?" & temp & "Page="&xl&">"&xl&"</a> ")&chr()
end if
next
else
if page= then
responseWrite("<span class=current></span>")&chr()
else
ResponseWrite("<a " & action & "?" & temp & "Page=></a> ")&chr()
end if
if page> then ResponseWrite("<span class=""disabled""></span>")&chr()
if page< then i= else i=page
if page > (pagecount) then i=pagecount else i=page+
for xll=i to i

if xll<> and xll <> pagecount then
if xll=page then
responseWrite("<span class=current>"&xll&"</span>")&chr()
else
ResponseWrite("<a href=""" & action & "?" & temp & "Page="&xll&""">"&xll&"</a>")&chr()
end if
end if

next
if page< (pagecount) then ResponseWrite("<span class=""disabled""></span>") &chr()
if page=pagecount then responseWrite("<span class=current>"&pagecount&"</span>")&chr() else ResponseWrite("<a " & action & "?" & temp & "Page="&pagecount&">"&pagecount&"</a> ") &chr()
end if
responseWrite("</div>")&chr()
End Sub
%>

上一篇:asp获取用户真实IP地址的方法

下一篇:ASP隐藏下载地址及防盗代码