写段ASP的代码,你可以参考
if rs.pagecount>10 then
minpage=1
maxpage=10
con=clng(request("con"))
if page>maxpage then
if con=10 then
minpage=page
maxpage=minpage+9
elseif con=0 then
maxpage=page
minpage=maxpage-9
else
minpage=page-con
maxpage=minpage+9
end if
end if
if minpage<>1 then
response.write "<a href=index.asp?page=" & minpage-1 & "&con=0 class='main'>[..]</a>"
end if
for ine=minpage to maxpage
if ine<>page then
response.write "<a href=index.asp?page=" & ine & "&con=" & (ine-minpage) & " class='main'>[" & ine & "]</a>"
else
response.write "<font size=2>" & ine & "</font>"
end if
if ine>rs.pagecount then exit for
next
if ine<=rs.pagecount then
response.write "<a href=index.asp?page=" & maxpage+1 & "&con=10 class='main'>[..]</a>"
end if
else
for ine=1 to rs.pagecount
if ine<>page then
response.write "<a href=index.asp?page=" & ine & " class='main'>[" & ine & "]</a>"
else
response.write "<font size=2>" & ine & "</font>"
end if
next
end if
end if