IT猫扑网:您身边最放心的安全下载站! 最新更新| 软件分类| 专题汇总| 手机版

您当前所在位置:IT猫扑网 > 网络编程 > Asp编程 > ASP实现长文章手动分页的代码

ASP实现长文章手动分页的代码

时间:2015-06-28 00:00 来源:IT猫扑网|http://www.itmop.com/ 作者:网管联盟 我要评论(0)

  一篇文章如字数太多,则用1,2,3....  分成多页,便于用户浏览。

<% 
set recordset1=server.createobject(&adodb.recordset&) 
exec=&SELECT * FROM news  where id=&&id 
recordset1.Open exec,conn,1,1 
%> 
 <table width=&85%& border=&0& align=¢er& cellpadding=&3& cellspacing=&0&>
    <tr>  <td >
.......

<%
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 %>
</td>
    </tr>
 <%if ubound(ContentStr)>=1 then%>
    <tr> 
<td height=&30& >本文共分 
<%
For p = 0 to ubound(ContentStr)
if p+1= Request(&page&)+1 then
a=&<font color=red>&
aa=&</font>&
else
a=&&
aa=&&
end if
%>
  <a href=&detail.asp?ID=<%=request(&ID&)%>&page=<%=p%>&><%=a%><%=p+1%><%=aa%></a> 
  <% Next %>
  页 </td>
    </tr>
    <%end if%>

   添加文章时,在想分页的地方,加入分割符 ||| 即可。

关键词标签:代码,手动,文章,实现

相关阅读 ASP编程代码:隐藏图片的真实地址 ASP教程:0177:800401f3错误解决 ASP代码中如何屏蔽ip地址 禁止某IP段访问网站 ASP彻底实现伪静态化html Ewebeditor及fckeditork单引号的问题 ASP实例:读取xml文件的程序

文章评论
发表评论

热门文章 Active Server Pages 错误 'ASP 0131'解决方法 Active Server Pages 错误 'ASP 0131'解决方法

相关下载

人气排行 ASP下标越界的解决方法 ASP代码中如何屏蔽ip地址 禁止某IP段访问网站 “文件共享锁定数溢出” 原因及解决方法 无法写入数据库的解决方法 ASP教程:0177:800401f3错误解决 ASP常用函数列表 如何用ASP来获取客户端真实IP的地址 ASP用FSO生成HTML简单实例+详解[原创] 用Asp编程实现QQ的在线情况查询 ASP彻底实现伪静态化html 解决:错误提示:Microsoft OLE DB Provider for ODBC Drivers (0x800040 如何在上传的图片上打自己的文字水印