ASP实现文章内容自动分页
网络整理 - 09-04
完整的代码如下:<table align="center" width="80%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center">
<%'content为文章内容
content="第一页内容|||第二页内容|||第三页内容|||第四页内容|||第五页内容"
if request.querystring("page")="" then
pagenum=0
else
pagenum=request.querystring("page")
end if
contentstr=split(content,"|||")
for i=pagenum to pagenum
response.write contentstr(i)
next%>
</td>
</tr>
<%if ubound(contentstr)>=1 then%>
<tr>
<td align="center">本文共分
<%for p=0 to ubound(contentStr)
if p+1=request.querystring("page")+1 then
a="<font color=""red"">"
aa="</font>"
else
a=""
aa=""
end if
%>
<a href="?page=<%=p%>"><%=a%><%=p+1%><%=aa%></a>
<%next%>
页</td>
</tr>
<%end if%>
</table>
