ASP超长文章内容分页类

ASP 1369 0 2013-02-16

ASP超长文章内容分页类

Class jaesAsp_page
Public Sub showpage(str,page,url)
   if page="" or page=0 or isnull(page) or isempty(page) or isnumeric(page)=false then
     page=1
   else
     page=cint(page)
   end if
   str=split(str,"{nextpage}")
   abspage=page
   pcount=ubound(str)+1
   if page>cint(ubound(str)+1) or page<1 then
   response.write "err"
   else
   response.write str(page-1)&"<br><br><center> 共分为"&pcount&"页 "
   end if

   for p=0 to ubound(str)
   response.write "<a href="&url&"p="&p+1&">["&p+1&"]</a> "
   next
   response.write "当前第"&abspage&"/"&pcount&"页</center>"

End Sub
End Class
'调用类方法,{nextpage}为分页标签
url="url.asp?" '页面地址
p=request("p") '页码
str=content     '内容
set newpage=new jaesAsp_page
newpage.showpage str,p,url

上一篇:ASP突出显示查询字符函数

下一篇:ASP清除缓存,防止后退

讨论数量:0

请先登录再发表讨论。 2024-05-04

天涯网魂
3 杠 5 星
TA 的文章
TA 的随言
TA 的资源链