asp长文章分页

来源:互联网 发布:小学生数学题库软件 编辑:程序博客网 时间:2024/04/28 19:57
dim sContent,tempContent,pgCount,pageStr,currentPagecurrentPage=Request.QueryString("page")if currentPage="" Then currentPage=1ElsecurrentPage=CLng(currentPage)end ifpgCount=0sContent=rs("info")tempContent=Split(sContent,"<div>[--page--]</div>")pgCount=UBound(tempContent)+1if pgCount<1 thenResponse.Write(sContent)elsepageStr = ""if CurrentPage<>1 thenpageStr = pageStr & "<a style='margin:0 12px;' href ='?id="&id&"&page=" & (currentPage - 1) & "'>上一页</a>"elsepageStr = pageStr & "<span style='margin:0 12px;'>上一页</span>"end iffor i=1 to pgCountif i=currentPage thenpageStr = pageStr & "<span style='color: #0068BE;padding:2px 2px 0 2px; font-weight:bold;'>[" & i & "]</span>"elsepageStr = pageStr & "<a href ='?id="&id&"&page=" & i & "'>[" & i & "]</a>"end ifnextif currentPage<>pgCount thenpageStr = pageStr & "<a style='margin:0 12px;' href ='?id="&id&"&page=" & (currentPage + 1) & "'>下一页</a>"elsepageStr = pageStr & "<span style='margin:0 12px;'>下一页</span>"end ifResponse.Write(tempContent(currentPage-1))end if

 
原创粉丝点击