请问怎样实现长文章的分页效果???
在网上找了许多这样的代码,但都用不了,所以想在这里请问一下大家!本人是初学者,希望能有详细一点的!谢谢!!!!
程序代码:
<% dim articleStr,CurrentPage,Maxlen,totalLen,i,j,n articleStr="地方官环境口令地方官环境口令地方官环境口令地方官环境口令,地方官环境口令,地方官环境口令地方官环境口令地方官环境口令,地方官环境口令地方官环境口令地方官环境口令,地方官环境口令地方官环境口令地方官环境口令。地方官环境口令地方官环境口令地方官环境口令。地方官环境口令.<br>地方官环境口令地方官环境口令地方官环境口令.地方官环境口令地方官环境口令." Maxlen=20 totalLen=len(articleStr) if totalLen mod Maxlen = 0 then pageCounts=fix(totalLen/Maxlen) else pageCounts=fix(totalLen/Maxlen)+1 end if Response.write "总页数:"&pageCounts&"<br>" CurrentPage=Request("page") if CurrentPage="" then CurrentPage=1 end if if int(CurrentPage)>pageCounts then CurrentPage=int(pageCounts) end if i=(CurrentPage-1)*Maxlen+1 j=Maxlen Response.write mid(articleStr,i,j)&"<br>" if CurrentPage<2 then Response.write "上一页" else Response.write "<a href='?page="&CurrentPage-1&"'>上一页</a>" end if for n = CurrentPage-3 to CurrentPage+3 if n>0 and Clng(n)<=pageCounts then Response.write"<a href='?page="&n&"'>"&n&"</a> " end if next if CuttentPage=pageCounts then Response.write "下一页" else Response.write "<a href='?page="&CurrentPage+1&"'>下一页</a>" end if %>