id=Request.QueryString("ID")
leixing=trim(Request.QueryString("leixing"))
Set rs = Server.CreateObject ("ADODB.Recordset")
sql="select * from chanpin where leixing= '" & leixing & " ' "
rs.Open sql, conn,3,3
leixing=trim(rs("leixing"))
chanpin=trim(rs("chanpin"))
image=rs("image")
UpdateTime=trim(rs("UpdateTime"))
Content=trim(rs("Content"))
hot=rs("hot")
xin=rs("xin")
page=1 ' 设置变量PAGE=1
rs.PageSize =10'每页显示记录数
if Not IsEmpty(Request("Page")) then '如果PAGE已经初始化...
Page = CInt(Request("Page")) '接收PAGE并化为数字型赋给PAGE变量
if Page > rs.PageCount then '如果接收的页数大于总页数
rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后页
elseif Page <= 0 then '如果page小于等于0
Page = 1 '设置PAGE等于第一页
else
rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
end if
end if
Page = rs.AbsolutePage
For i = 1 to rs.PageSize
if rs.eof or rs.bof then
Exit For
else
%>
<table width="543" border="1" align="center" bordercolordark="#f3f3f3" bordercolorlight="#0099CC">
<tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<td align="center"><A href="readchanpin.asp?id=<%=rs("id")%>"><img src="images/chanpin/<%=rs("id")%>-1.gif" width="100" height="100" border="0"></a><p>
<A href="readchanpin.asp?id=<%=rs("id")%>"><%=rs("chanpin")%></A></p>
</td>
<%
if i mod 2=0 then 'MOD几就是几列,你的该成MOD 2就可以了
%>
</tr>
<tr>
<%
end if
rs.movenext
loop
%>
</tr>
<%
end if
next
%>
</table>
<table align="center">
<tr>
<td align="center">
<%if request("page")>1 then%>
<a href="ProList.asp?Page=<% = 1%>">首页</a> <a href="ProList.asp.asp?Page=<% =request("page") -1 %>">上一页</a>
<%end if %>
<%if request("page")<>rs.pagecount then %>
<a href="ProList.asp?Page=<% =request("page") + 1%>">下一页</a> <a href="ProList.asp?Page=<% = rs.PageCount%>">尾页</a>
<% end if %>
<%
rs.close
Set rs = Nothing
conn.close
set conn=nothing
%>