ASP 如何让循环显示达到分页效果?

来源:百度知道 编辑:UC知道 时间:2024/09/23 15:23:34
以下这段代码是一个留言本的后台管理显示代码,现在上有多少显示多少,我想把它每页只显示10条,多的在下一页,下一页显示,请高手帮我把代码修改一下,谢谢了哦!

<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><TABLE id=Table40 cellSpacing=1 cellPadding=3 width=100%
bgColor=#999999 border=0>
<TBODY>
<TR>
<TD colspan="2" bgColor=#EAEAEA><TABLE width="100%"
border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD height="21"><P style="MARGIN-TOP: 3px; MARGIN-LEFT: 10px"><font color="#2319DC">网站标题: <%=rs("titledata")%></font></P></TD>
<TD width="182">提交时间:<%=rs("data")%></TD>
<TD

你看看我的代码吧,比较简单,学习一下。地址是:
http://hi.baidu.com/vain%5Fqu/blog/item/32e6dac4a1cbcdca39db49ff.html

<%
const maxperpage=10 '定义每一页显示的数据记录的常量
dim currentpage '定义当前页的变量
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if currentpage="" or currentpage<1 then
currentpage=1

else
currentpage=clng(currentpage)
end if
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
'如果变量currentpage的数据类型不是数值型
'就1赋给变量currentpage
if not isnumeric(currentpage) then
currentpage=1
end if

dim totalput,n '定义变量
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then