帐号: 密码:
// 设为首页 // 收藏本站 // 请您留言 // 网址导航
远方教程-满足你的求知欲!
站内搜索:
HTML ASP PHP CSS DIV Dreamweaver Photoshop Word Excel PPT SEO技巧
您当前位置:网站首页 >> ASP教程 >> ASP优化技巧 >> 阅读文章

ASP文章手动分页 ASP长篇文章分页显示

来源:远方教程 作者:远方教程 发布时间:2015-02-25 查看次数:2676 访问[新版]

'过程名:ManualPagination
'作   用:采用手动分页方式显示文章具体的内容
'参   数:无
'==================================
sub ManualPagination()
dim ArticleID,strContent,CurrentPage
dim ContentLen,MaxPerPage,pages,i
dim arrContent
ArticleID=rs("ArticleID")
strContent=rs("Content")
ContentLen=len(strContent)
CurrentPage=trim(request("ArticlePage"))
if Instr(strContent,"[Next_Page]") <=0 then
response.write strContent
response.write" </p> <p align='center '> <font color= 'red'> <b> [1] </b> </font> </p>"
else
arrContent=split(strContent,"[Next_Page]")

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

打印 打印 | 关闭 关闭 评论
相关文章
图片新闻
站内搜索  
搜索
猜您喜欢  
最新更新  
阅读排行  
关于我们 | 联系方式 | 大事记 | 免责声明 | | 给我留言
部分广告源自金山联盟2345联盟 QQ咨询 站长之家QQ群:232617873
Copyright 2024 远方教程 © All Rights Reserved.

回顶部