提供一款比较完整的asp教程分页函数,这款分页类可以实现上一页,下一页,等功能。
'仅供参考,你可以任意修改、传播;如果你对它进行了改良,希望你能给我一个
'副本,谢谢。
'--------------------------------------------------------------------
class turnpage
dim spageno,spagesize,spagecount,srecordcount,sabsoluterecord
private sub class_initialize()
spageno=trim(request.querystring("pageno"))
if spageno<>"" then
spageno = cdbl(spageno)
else
spageno = 1
end if
sabsoluterecord = 1
end subpublic sub getrs(byref conn,byref rs,byval sql,byval pagesize)
rs.open sql,conn,1,1
rs.pagesize = pagesize
spagesize = rs.pagesize
spagecount = rs.pagecount
srecordcount = rs.recordcount
if not rs.eof then rs.absolutepage = spageno
end sub
public function eof()
if sabsoluterecord<=spagesize then
'sabsoluterecord = sabsoluterecord + 1
eof = false
else
eof = true
end if
end function
public sub movenext()
sabsoluterecord = sabsoluterecord + 1
end sub
public sub getpagelist()
if spagecount<=1 then exit sub
dim surl,stmp,squery_string,p,n,i,a,b
surl = request.servervariables("url")
squery_string = request.servervariables("query_string")
stmp = split(surl,"/")
surl = stmp(ubound(stmp))
if squery_string <> "" then squery_string=replace(squery_string,"pageno=" & spageno,"")
if squery_string = "" then
surl = surl & "?"
else
surl = surl & "?" & squery_string & "&"
end if
surl = replace(surl,"&&","&")
p = spageno-1
n = spageno+1
if p<1 then p = 1
if n>spagecount then n = spagecount
a = spageno-5
b = spageno+5
if a<1 then a = 1
if b>spagecount then b = spagecount
response.write("")")
if spageno>1 then response.write("首页 上页")
for i=a to b
response.write(" if i = spageno then response.write(" style=""font-weight:bold; color:#ff0000;""")
response.write(">" & i & "")
next
if spageno < spagecount then response.write(" 下页 末页")response.write("
end sub
public sub getpagehtmllist(baseurl)
if spagecount<=1 then exit sub
dim p,n,i,a,b
p = spageno-1
n = spageno+1
if p<1 then p = 1
if n>spagecount then n = spagecount
a = spageno-5
b = spageno+5
if a<1 then a = 1
if b>spagecount then b = spagecount
response.write("")")
if spageno>1 then response.write("首页 上页")
for i=a to b
response.write(" if i = spageno then response.write(" style=""font-weight:bold; color:#ff0000;""")
response.write(">" & i & "")
next
if spageno < spagecount then response.write(" 下页 末页")
response.write("
end sub
end class
一亿小目标手游
如果让你的人生从来,你可以像王健林一样霸气的表示一亿小目标吗
一亿小目标手机版2019
一亿小目标手机版2019趣味休闲模拟游戏,玩家在游戏中将会通
巴啦啦梦幻餐厅
巴啦啦梦幻餐厅是一款充满魔幻色彩的二次元模拟经营手游,游戏界
恋爱进行时九游版
恋爱进行时九游版是一款以模拟恋爱玩法为核心的角色扮演手游,精
皇室对决fr(Null’s Royale)
皇室对决fr,即皇室战争的私服变态版本,在该版本中玩家能够拥