太长了,看看我的分页函数
<% dim doc_count,page,PageSize,pgnum,i,j,k
PageSize=33
Function div_page()
if int(doc_count mod PageSize )<>0 then
pgnum=int(doc_count/pagesize)+1
else
pgnum=int(doc_count/pagesize)
end if
if page="" then page=Int(Request.QueryString("page"))+1
if page="" then page=int(Request.form("page"))+1
page=int(page-1)
if page="" or page<=0 then page=0
if page>=pgnum then page=pgnum-1
if (page*PageSize < doc_count) and (doc_count-page*PageSize)<PageSize then
k=doc_count-(page*PageSize)-1
else
k=PageSize-1
end if
End Function
Function list_div_page() %>
分页:|<%k=page+9
if k>=pgnum then k=pgnum-1
for i=page to k
j=i+1
response.write this_page&"="&i&">"&j&"</a>|"
next
End Function %>