日期:2014-05-16  浏览次数:20902 次

以下ASP代码如何实现用page分页
<%
ArticlePageContent=split(ArticleContent,"<hr style=""page-break-after:always;"" class=""ke-pagebreak"" />")
response.write (ArticlePageContent(i))
c=ubound(ArticlePageContent)
if c>0 then
for i=0 to c
if i=0 then
PageNO=""
else
PageNO=i+1
PageNO="("&PageNO&")"
end if
%>
<%=PageList%>
<%
'分页部分
PageList=""
PageList=PageList&"<div class=""t_page ColorLink"">"
PageList=PageList&"当前页数:<span class=""FontRed"">" & i+1 & "</span>/" & c+1 &"&nbsp;"
PageList=PageList&"<a href=""article.asp?id="&id&""">" & "首页" & "</a>"
select case i
case 0
PageList=PageList&"&nbsp;&nbsp;上一页&nbsp;&nbsp;"
case 1
PageList=PageList&"<a href=""narticle.asp?id="&id&""">" & "上一页" & "</a>"
case else
PageList=PageList&"<a href=""article.asp?id="&id&"&page="&i-1&""">" & "上一页" & "</a>"
end select
for counter=0 to c
if counter=0 then
if counter=i then
PageList=PageList&"&nbsp;&nbsp;1&nbsp;&nbsp;"
else
PageList=PageList&"<a  href=""article.asp?id="&id&""">" & 1 & "</a> "
end if
else
if counter=i then
PageList=PageList&"&nbsp;&nbsp;"&counter+1&"&nbsp;&nbsp;"
else
PageList=PageList&"<a  href=""article.asp?id="&id&"&page="&counter&""">" & counter+1 & "</a> "
end if
end if
next
if i=c then
PageList=PageList&"&nbsp;&nbsp;下一页&nbsp;&nbsp;"
else
PageList=PageList&"<a href=""article.asp?id="&id&"&page="&i+1&""">" & "下一页" & "</a>"
end if
PageList=PageList&"<a href=""article.asp?id="&id&"&page="&c&""">" & "尾页" & "</a></div>"
next
end if
%>


以上代码如何实现用page实现分页,希望高手帮忙修改下,也可也给段分页的代码
ASP 分页

------解决方案--------------------
居然没有人回答,我来回答啊,捡分咯,哈哈
<div id="scrollContent"   style="overflow-x:hidden;">
<%
'分页模块
dim i,page
rs.pagesize=5
allpage=rs.pagecount
allcount=rs.recordcount
page=request.QueryString("page")
if allcount>=1 then
if page="" then page=1
if isnumeric(page) then
if clng(page)<1 then page=1
if clng(page)>allpage then page=allpage
else
page=1
end if
if not rs.eof then
rs.absolutepage=page
end if
%