那个翻页程序是:
function JoinChar(strUrl)
if strUrl="" then
JoinChar=""
exit function
end if
if InStr(strUrl,"?")<len(strUrl) then
if InStr(strUrl,"?")>1 then
if InStr(strUrl,"&")<len(strUrl) then
JoinChar=strUrl & "&"
else
JoinChar=strUrl
end if
else
JoinChar=strUrl & "?"
end if
else
JoinChar=strUrl
end if
end function
sub showpage(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit)
if totalnumber>0 then
dim n, i,strTemp,strUrl
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
strTemp=strTemp & "共 <font color=blue><b>" & totalnumber & "</b></font> " & strUnit & " "
strUrl=JoinChar(sfilename)
if PageNo<2 then
strTemp=strTemp & "首页 上一页 "
else
strTemp=strTemp & "<a href='" & strUrl & "PageNo=1'>首页</a> "
strTemp=strTemp & "<a href='" & strUrl & "PageNo=" & (PageNo-1) & "'>上一页</a> "
end if
if n-PageNo<1 then
strTemp=strTemp & "下一页 尾页"
else
strTemp=strTemp & "<a href='" & strUrl & "PageNo=" & (PageNo+1) & "'>下一页</a> "
strTemp=strTemp & "<a href='" & strUrl & "PageNo=" & n & "'>尾页</a>"
end if
strTemp=strTemp & " 页次:<strong><font color=red>" & PageNo & "</font>/" & n & "</strong>页 "
strTemp=strTemp & " <b>" & maxperpage & "</b>" & strUnit & "/页"
if ShowAllPages=True then
strTemp=strTemp & " 转到:<select name='page' size='1' onchange=""javascript:window.location='" & strUrl & "PageNo=" & "'+this.options[this.selectedIndex].value;"">"
for i = 1 to n
strTemp=strTemp & "<option value='" & i & "'"
if cint(PageNo)=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">第" & i & "页</option>"
next
strTemp=strTemp & "</select>"
end if
response.write strTemp
end if
end sub
下面的代码是在index_photo_show.asp里面的,就是下面那一部分的图片列表,
if not rs.eof then
dim maxperpage,url,PageNo
url="index_photo_list.asp"
rs.pagesize=10
PageNo=REQUEST("PageNo")
if PageNo="" or PageNo=0 then PageNo=1
RS.AbsolutePage=PageNo
TSum=rs.pagecount
maxperpage=rs.pagesize
RowCount=rs.PageSize
PageNo=PageNo+1
PageNo=PageNo-1
if CINT(PageNo)>1 then
if CINT(PageNo)>CINT(TSum) then
response.Write("对不起没有您想要的页数")
Response.End
end if
end if
if PageNo<0 then
response.Write("没有这一页!")
Response.End
End if
end if