|
asp自动分页应该如何写??下面的要根据换行来判断不行,因为内容多数都是自动换行,如果根据字符多少来判断怎么写的??
dim page,pagecount,thispage,linenum,allline
const pageline=10
linenum=split(content,"<br>")
allline=ubound(linenum)+1
pagecount=int(allline\pageline)+1
page=request("page")
if isempty(page) then
thispage=1
else
thispage=cint(page)
end if
for i=0 to allline
if i+1>thispage*pageline-pageline and i<thispage*pageline then
response.write linenum(i) &"<br>"
end if
next
for i=1 to pagecount
if thispage=i then
response.write i & " "
else
response.write "<a href='?page="&i&"&zixunid="&zixunid&"'>"&i&"</a> "
end if
next |
|