请问下面这段代码按类查询后
怎样按分类结果分页显示呢???
<!--#include file="conn.asp"-->
<%
dim rs
dim sql
Set rs=server.CreateObject("ADODB.recordset")
if request.form("title")<>"" then
sql="select * from class_content where class_1='"&request.form("title")&"' order by time desc" //按分类查询部分
rs.open sql,conn,1,1
PageSize=20
pagecount=rs.PageCount
page=int(request.QueryString ("page"))
page=0
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page
else
sql="select * from class_content order by time desc"
rs.open sql,conn,1,1
rs.PageSize=20
pagecount=rs.PageCount
page=int(request.QueryString ("page"))
if page<=0 then page=1
if request.QueryString("page")="" then page=1
rs.AbsolutePage=page
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>北京生活网=>修改或删除内容</title>
<link href="../css/lifeshow.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #c4ddff;
}
-->
</style></head>
<body>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0000FF">
<tr bgcolor="#C4DDFF"><td colspan="5" align="center"><font class=title color=#ff0000>修改或删除内容</font></td>
</tr>
<tr bgcolor="#C4DDFF"><td colspan="5" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="form1" action="update_content_face.asp" method="post">
<tr>
<td width="28%" class="font_20">指定文章类别:</td>
<td width="60%"><input name="title" type="text" size="30"></td>
<td width="12%"><div align="center">
<input type="submit" name="Submit" value="提交">
</div></td>
</tr></form>
</table></td>
</tr>
<tr bgcolor="#C4DDFF" class="font_20">
<td><div align="center"><strong>栏目</strong></div></td>
<td><div align="center"><strong>分栏</strong></div></td>
<td><div align="center"><strong>标题</strong></div></td>
<td><div align="center"><strong>修改</strong></div></td>
<td><div align="center"><strong>删除</strong></div></td>
</tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<tr bgcolor="#C4DDFF" class="font_20">
<td align="center" class="font_20"><%=rs("class_1")%></td>
<td align="center" class="font_20"><%=rs("class_2")%></td>
<td class="font_20"><%=rs("title")%></td>
<td align="center"><a href="update_content.asp?id=<%=rs("id")%>" class="font_20">修改</a></td> //未分类时的分分页显示若分类后这部分应该怎么处理呢
<td align="center"><a href="del_content.asp?id=<%=rs("id")%>" class="font_20">删除</a></td>
</tr>
<%
rs.movenext
if i mod 20 =0 then
exit do
end if
loop%>
<tr bgcolor="#C4DDFF" class="font_20">
<td colspan="5" align="right" class="font_20">
<%for j=1 to pagecount
response.write("<a href=update_content_face.asp?page="&j&">"&j&"</a> ")
next%> </td></tr>
</table>
</body>
</html>
[此贴子已经被作者于2005-12-5 16:41:09编辑过]