回复 23楼 wangjy500
<%
Dim X_typestr
X_typestr=Request.QueryString("typestr")
Dim db,strSql,rs
Set db=Server.CreateObject("ADODB.Connection")
db.Open "Dsn=background"
Set rs=Server.CreateObject("ADODB.Recordset")
strSql="Select * From news where typestr ='鲁菜'order by id desc"
rs.Open strSql,db,1
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<HTML xmlns="http://www.
<HEAD><TITLE>菜单!</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style type="text/css">
<!--
.wang500 {
width: 508px;
margin: 0px;
padding: 0px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: none;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color:
#1f92ff;
border-right-color:
#1f92ff;
border-bottom-color:
#1f92ff;
border-left-color:
#1f92ff;
}
.wang500 div {
float: left;
height: 25px;
width: 148px;
margin-left: 15px;
line-height: 25px;
}-->
</style>
</HEAD>
<BODY>
<table cellspacing="0" cellpadding="0" width="510"
background="../images/tu_di.gif" border="0">
<tr>
<td width="7"><img height="29" src="../images/tu(1).gif" width="7" /></td>
<td ><font color="#ffffff"><b>列表</b></font></span></td>
<td width="7"><img height="29" src="../images/tu1.gif" width="7" /></td>
</tr>
</table>
<%
Rs.PageSize = 4
If Request("PageNo") = "" Then PageNo=1 Else PageNo = CInt(Request("PageNo"))
If PageNo < 1 Then Response.Redirect "?PageNo=1"
If PageNo > Rs.PageCount And Rs.PageCount > 0 Then Response.Redirect "?PageNo=" & Rs.PageCount
If Rs.Eof and Rs.Bof Then PageNo = 0 Else Rs.AbsOlutePage = PageNo
%>
<div class="wang500">
<%For x = 1 to Rs.PageSize
If Rs.Eof Then Exit For
%>
<div><li><%
if
not rs.eof then
if len(rs("title")) > 8
then
if (InStr(rs("memo"),"<img")>0) or (InStr(rs("memo"),"<IMG")>0) then
%><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><%
response.Write left(rs("title"),5)&" ..." %></a> <img src="../images/pic.gif" width="12" height="12"><%
else
%><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><%
response.Write left(rs("title"),5)&" ..."%></a><%
end if
else
if (InStr(rs("memo"),"<img")>0) or (InStr(rs("memo"),"<IMG")>0)
then
%><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><%
response.write rs("title")%></a> <img src="../images/pic.gif" width="12" height="12"><%
else
%><a href="zw.asp?id=<%=rs("id")%>" target="_blank"><%
response.write rs("title")%></a><%
end if
end if
end if
%></li></div>
<%rs.movenext
next%>
<table cellspacing="0" width="508" border="0" >
<tr><td> </td></tr>
<tr>
<td align="center">
总[<span class="style1">
<% = Rs.RecordCount%>
</span>]条<strong>|</strong> <span class="style1">
<% = Rs.PageSize%>
</span>条<strong>/</strong>页 <strong>|</strong> 当前<span class="style1">
<% = PageNo%>
</span><strong>/</strong><span class="style1">
<% = Rs.PageCount%>
</span>页 <a href="Untitled-2.asp?PageNo=<% =Rs.AbsOlutePage%>">首页</a> <a href="Untitled-2.asp?PageNo=<% = PageNo - 1%>">上一页</a> <a href="Untitled-2.asp?PageNo=<% = PageNo + 1%>">下一页</a> <a href="Untitled-2.asp?PageNo=<% =Rs.PageCount%>">尾页</a>
<!--分页代码结束-->
</td>
</tr>
</table>
</div>
</BODY></HTML>
麻烦指点