<%
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 &" "
PageList=PageList&"<a href=""article.asp?id="&id&""">" & "首页" & "</a>"
select case i
case 0
PageList=PageList&" 上一页 "
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&" 1 "
else
PageList=PageList&"<a href=""article.asp?id="&id&""">" & 1 & "</a> "
end if
else
if counter=i then
PageList=PageList&" "&counter+1&" "
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&" 下一页 "
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
%>
<table class="tableStyle">
<tr>
<th class="th">ID</th>
<th class="th">发文标题</th>
<th class="th">发文人</th>
<th class="th">审批人</th>
<th class="th">发布日期</th>
</tr>
<%
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>
<tr>
<td><% =rs("id")%></td>
<td><% =rs("title")%></td>
<td><% =rs("content")%></td>
<td><% =rs("linkman")%></td>
<td><% =rs("tel")%></td>
</tr>
<%
rs.movenext
next
%>
<tr>
<td colspan="5">
<p style="text-align:center;text-indent:40px;">
<%if allpage > 0 then%>
当前页<%=page%>/<%=allpage%>
------解决方案--------------------
每页<%=rs.pagesize%>条信息
------解决方案--------------------
共<%=allcount%>条信息
------解决方案--------------------
<%else%>
当前页0/0
<%end if%>
<a href="shou.asp?page=1>">首页</a>
------解决方案--------------------
<%if page<>1 then%>
<a href="shou.asp?page=<%=page-1%>">上页</a>
------解决方案--------------------
<%end if%>
<%if page<>allpage then%>
<a href="shou.asp?page=<%=page+1%>">下页</a>
------解决方案--------------------
<%end if%>
<a href="shou.asp?page=<%=allpage%>">尾页</a>