APP NEWS
ASP实现长文章手动分页的代码
一篇文章如字数太多,则用1,2,3.... 分成多页,便于用户浏览。<% set recordset1=server.createobject("adodb.recordset") exec="SELECT *&nb
2015-06-28 00:000 次阅读
一篇文章如字数太多,则用1,2,3.... 分成多页,便于用户浏览。
set recordset1=server.createobject(&adodb.recordset&)
exec=&SELECT * FROM news where id=&&id
recordset1.Open exec,conn,1,1
%>
<%
set recordset1=server.createobject(&adodb.recordset&)
exec=&SELECT * FROM news where id=&&id
recordset1.Open exec,conn,1,1
%>
| ....... <% If Request(&page&)=&& Then pageNum=0 Else pageNum=Request(&page&) End if Content=Replace(recordset1(&content&),&|||&,&|||&) ContentStr=split(Content,&|||&) For i=pageNum to pageNum %> <%=ContentStr(i)%> <% Next %> |
| 本文共分 <% For p = 0 to ubound(ContentStr) if p+1= Request(&page&)+1 then a=&& aa=&& else a=&& aa=&& end if %> &page=<%=p%>&><%=a%><%=p+1%><%=aa%> <% Next %> 页 |






