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

来源: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
投稿

猜你喜欢

  • 开发保留标准的浏览器功能的AJAX应用

    2008-02-03 14:03:00
  • ORACLE 最大连接数的问题

    2009-07-23 14:27:00
  • MySQL的远程连接出现错误提示分析

    2011-07-01 11:34:00
  • Stored Procedure(存储过程)编写经验和优化措施

    2008-03-12 12:03:00
  • 如何使用SQLServer数据库查询累计值

    2009-03-16 14:43:00
  • 如何用SA-FileUp上传一个单纯的HTML文件?

    2010-05-18 18:29:00
  • CSS灵活运行注释带来的益处

    2008-04-21 13:51:00
  • asp从Excel中筛选符合条件的记录保存至新的Excel中

    2007-09-06 19:20:00
  • 10条影响CSS渲染速度的写法与建议

    2008-09-09 22:02:00
  • 简单代码屏蔽超级链接虚线框

    2008-02-03 11:34:00
  • sql数据库批量处理脚本

    2011-11-03 17:23:19
  • 19个ASP编程基础典型代码

    2008-10-23 15:46:00
  • 用asp编写文档搜索页面

    2008-01-13 07:04:00
  • 图像替换新技术:状态域方法[译]

    2009-08-06 16:41:00
  • 5招优化MySQL插入方法

    2009-04-02 10:49:00
  • 使用FSO把文本信息导入数据库

    2007-09-27 20:20:00
  • 运行(runCode)复制(copyCode)保存(saveCode)代码框方法

    2007-10-21 08:41:00
  • T-SQL问题解决集锦 数据加解密全集

    2012-07-11 15:34:08
  • Oracle7.X 回滚表空间数据文件误删除处理方法

    2010-07-28 12:54:00
  • oracle应用程序实现打包 的方法

    2009-03-02 10:32:00
  • asp之家 网络编程 m.aspxhome.com