慕斯王
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><%sitePath="data.mdb"dim connset conn=server.CreateObject("adodb.connection")conn.open "provider=microsoft.jet.oledb.4.0; data source="&server.mappath("/"&sitePath)set rs=server.CreateObject("adodb.recordset")sql="select * from Aspcms_News where NewsID=5 "rs.open sql,conn,1,1if not rs.eof thennumbers=len(rs("content")) '总字节数pagenum=900 '每页显示的数量maxpage=-int(-numbers/pagenum)'总页数requestpage=clng(request("p"))'接收页码if requestpage="" or requestpage=0 then'获取默认页码requestpage=1end ifif requestpage>maxpage then '当前页的页码大于最大页码时,使当前页码等于最大页码requestpage=maxpageend ifif not requestpage=1 then '当前页码不等于1时,向下移动相应的字节数content=mid(rs("Content"),(requestpage-1)*pagenum+1,900)elsecontent=left(rs("Content"),900) '当页码等于1时,截取相应文本end ifif isempty(requestpage) thenthispage=1elsethispage=cint(requestpage)end if%><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>对超长文本数据进行分页显示</title></head><body ><table width="470" border="0" cellspacing="0"><tr><td height="33"><div align="center"><strong><%=rs("Title")%></strong></div></td></tr><tr><td> <font size="2"><%' =content%><%=Replace(content,chr(13),"<br>")%></font></td></tr><tr><td align="right"><font size="2">总页数:<%=maxpage%> 当前页:<%=requestpage%> <a href="content_page.asp?p=1">第一页</a> <a href="content_page.asp?p=<%=(requestpage-1)%>">上一页</a> <a href="content_page.asp?p=<%=(requestpage+1)%>">下一页</a> <a href="content_page.asp?p=<%=maxpage%>">最后一页</a></font></td></tr><tr><td align="right"><%for i=1 to maxpageif thispage=i thenresponse.write ""&i&" "else %>[<a href="content_page.asp?p=<%=i%>"><%=i%></a>]<% end if %><%next%></td></tr> </table><%elseresponse.Write("没有内容")end if%></body></html>我参考的这个代码,可以正常分页,却有html代码