#22004/8/11 15:07:46
...
set rs=server.createobject("adodb.recordset")
dim pagesize
pagesize=20 '===一页的记录数
page=request("page")
if page="" or not(isnumeric(page)) then
page=1
end if
url="lawlist.asp"
rs.open sql,conn,1,1
if not rs.EOF then
rs.PageSize=pagesize
pagecount=rs.pagecount
if int(page)>int(pagecount) then
page=pagecount
end if
rs.AbsolutePage=page
row=pagesize
end if%>
...
<%if not rs.eof then%>
<table border="0" width="99%">
<tr>
<td width="100%">
[<a href="<%=url%>?page=1" title="确定">首页</a>|
<%if int(page)<=1 then%>
上一页|<%
else%>
<a href="<%=url%>?page=<%=page-1%>" title="确定">上一页</a>|
<%end if%>
<%if int(page)>=int(pagecount) then%>
下一页|<%
else%>
<a href="<%=url%>?page=<%=page+1%>" title="确定">下一页</a>|
<%end if%>
<a href="<%=url%>?page=<%=pagecount%>" title="确定">尾页</a>] 共 <%=pagecount%> 页,当前第
<font color="#FF0000"> <%=page%> </font> 页,计 <%=rs.recordcount%> 条记录
</td>
</tr>
</table>
<div align="center">
<center>
<table border="0" width="99%" cellspacing="1" cellpadding="0">
<tr>
<td width="4%" height="35" align="center" bgcolor="#6699FF"><font color="#FFFFFF"><b>序号</b></font></td>
<td width="31%" height="35" align="center" bgcolor="#6699FF"><font color="#FFFFFF"><b>标题</b></font></td>
<td width="55%" height="35" align="center" bgcolor="#6699FF"><font color="#FFFFFF"><b>内容</b></font></td>
<td width="10%" height="35" align="center" bgcolor="#6699FF"><font color="#FFFFFF"><b>操作</b></font></td>
</tr><%
i=0
do while not rs.eof and row>0
i=i+(page-1)*row+1
%>
<tr bgcolor="#E6F2FF" onmouseOver="mOvr(this,'#D5D2FB');" onmouseOut="mOut(this,'#E6F2FF');">
<td width="4%" height="25" align="center"><%=i%></td>
<td width="31%" height="25" align="left"> <%=rs("title")%></td>
<td width="55%" height="25" align="left" valign="middle"> <%=left(rs("content"),30)%>...</td>
<td width="10%" height="25" align="center"><font color="#FF0000"><a href="law.asp?id=<%=rs("id")%>"><font color="#FF0000">修改</font></a><font color="#FF0000">|</font><a href="law_del.asp?id=<%=rs("id")%>" onclick="return confirm('确定删除吗?');"><font color="#FF0000">删除</font></a></font></td>
</tr> <%
row=row-1
rs.movenext
loop%>
</table>
</center>
</div>
<%else
%>
<table border="0" width="90%" height="80">
<tr>
<td width="100%" height="76">
<p align="center">暂无记录</p>
</td>
</tr>
</table>
<%end if%>
</center>
</body>
</html>
<%
conn.close
set conn=nothing%>