采用手动分页方式显示文章具体的内容

来源:asp之家 时间:2009-10-29 11:58:00 

过程名:ManualPagination

作 用:采用手动分页方式显示文章具体的内容

参 数:ArticleID,strContent

Sub ManualPagination(ArticleID,strContent)
dim CurrentPage
dim ContentLen,MaxPerPage,pages,i
dim arrContent,strFileName
strFileName="ShowArticle.asp"
ContentLen=len(strContent)
CurrentPage=trim(request("ArticlePage"))
if Instr(strContent,"wswsws")<=0 then
   response.write strContent
   'response.write "</p><p align='center'><font color='red'><b>[1]</b></font></p>"
else
   arrContent=split(strContent,"wswsws")

   pages=Ubound(arrContent)+1
   if CurrentPage="" then
    CurrentPage=1
   else
    CurrentPage=Cint(CurrentPage)
   end if
   if CurrentPage<1 then CurrentPage=1
   if CurrentPage>pages then CurrentPage=pages

   response.write arrContent(CurrentPage-1)

   response.write "</p><p align='center'><b>"
   if CurrentPage>1 then
    response.write "<a href='" & strFileName & "?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage-1 & "'>上一页</a>&nbsp;&nbsp;"
   end if
   for i=1 to pages
    if i=CurrentPage then
     response.write "<font color='red'>[" & cstr(i) & "]</font>&nbsp;"
    else
     response.write "<a href='" & strFileName & "?ArticleID=" & ArticleID & "&ArticlePage=" & i & "'>[" & i & "]</a>&nbsp;"
    end if
   next
   if CurrentPage<pages then
    response.write "&nbsp;<a href='" & strFileName & "?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage+1 & "'>下一页</a>"
   end if
   response.write "</b></p>"
end if
End Sub

标签:分页,文章,内容
0
投稿

猜你喜欢

  • python使用selenium打开chrome浏览器时带用户登录信息实现过程详解

    2023-07-19 05:00:37
  • 将内容自动添加到指定文本域的JS

    2007-10-08 12:50:00
  • ASP生成静态页面的方法

    2010-05-27 12:13:00
  • pycharm无法安装第三方库的问题及解决方法以scrapy为例(图解)

    2022-11-01 20:53:28
  • Python简单实现Base64编码和解码的方法

    2022-05-14 12:22:35
  • 优化MySQL的数据库性能的八种方法

    2012-01-05 19:28:53
  • pytorch 带batch的tensor类型图像显示操作

    2023-06-02 08:47:26
  • Python生成词云的实现代码

    2023-09-12 22:42:48
  • Go代码检查的推荐工具及使用详解

    2024-05-09 15:00:11
  • MySQL死锁的产生原因以及解决方案

    2024-01-26 16:11:40
  • python 求两个向量的顺时针夹角操作

    2021-05-26 13:31:10
  • 像懒人一样去设计

    2009-04-23 12:43:00
  • Python给你的头像加上圣诞帽

    2023-08-28 11:30:41
  • python的concat等多种用法详解

    2022-08-14 23:37:18
  • 数据分页显示按钮,自动获取url链接

    2009-06-22 12:59:00
  • 使用python编写android截屏脚本双击运行即可

    2021-01-25 20:47:19
  • 网站重构 CSS样式表的优化技巧

    2009-05-12 11:51:00
  • 了解ASP的基本语法和变量

    2008-01-16 13:03:00
  • 保存透明gif时出现锯齿解决法

    2008-06-26 18:10:00
  • 一列保存多个ID(将多个用逗号隔开的ID转换成用逗号隔开的名称)

    2012-08-21 10:37:37
  • asp之家 网络编程 m.aspxhome.com