微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

asp长文章分页

dim sContent,tempContent,pgCount,pageStr,currentPage

currentPage=Request.QueryString("page")

if currentPage="" Then 

currentPage=1

Else

currentPage=CLng(currentPage)

end if

pgCount=0

sContent=rs("info")

tempContent=Split(sContent,"<div>[--page--]</div>")

pgCount=UBound(tempContent)+1

if pgCount<1 then

Response.Write(sContent)

else

pageStr = ""

if CurrentPage<>1 then

pageStr = pageStr & "<a margin:0 12px;' href ='?id="&id&"&page=" & (currentPage - 1) & "'>上一页</a>"

else

pageStr = pageStr & "<span margin:0 12px;'>上一页</span>"

end if

for i=1 to pgCount

if i=currentPage then

pageStr = pageStr & "<span color: #0068BE;padding:2px 2px 0 2px; font-weight:bold;'>[" & i & "]</span>"

else

pageStr = pageStr & "<a href ='?id="&id&"&page=" & i & "'>[" & i & "]</a>"

end if

next

if currentPage<>pgCount then

pageStr = pageStr & "<a margin:0 12px;' href ='?id="&id&"&page=" & (currentPage + 1) & "'>下一页</a>"

else

pageStr = pageStr & "<span margin:0 12px;'>下一页</span>"

end if

Response.Write(tempContent(currentPage-1))

end if

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐