asp分页显示问题?
为什么第一页把全部的数据多显示出来,不过点击下一页,下一页又显示正常的内容?到底那里错了? <table width="100%" border="0" cellpadding="0" cellspacing="0">
<%page=request.QueryString("page")
if not isempty(page) then
PageCount=cint(page)
else
PageCount=1
end if
n=1
exec="select * from Products where CID=5 order by ID desc"
set rs=server.CreateObject("adodb.recordset")
rs.PageSize=20
rs.open exec,conn,1,1
filename="motif.asp"
if rs.RecordCount<=0 then
%>
<tr><td class="llpj" height="300" valign="top">暂无相关信息</td></tr>
<% else
rs.AbsolutePage=PageCount
do while not rs.eof
%>
<%For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if
if (i mod 4)=1 then
%>
<tr><td width="25%">
<table width="160" cellspacing="0" cellpadding="0" border="0" class="mp">
<tr valign="bottom" height="160"><td align="center">
<a href="product_series_content.asp?id=<%=rs("id")%>">
<img src="<%=rs("ProImage")%>" border="0"/></a>
</td></tr></table></td>
<%else
if (i mod 4)=0 then
%>
<td width="25%">
<table width="160" cellspacing="0" cellpadding="0" border="0" class="mp">
<tr valign="bottom" height="160"><td align="center">
<a href="product_series_content.asp?id=<%=rs("id")%>">
<img src="<%=rs("ProImage")%>" border="0"/></a>
</td></tr></table></td></tr>
<tr><td colspan="4"> </td></tr>
<%else%>
<td width="25%">
<table width="160" cellspacing="0" cellpadding="0" border="0" class="mp">
<tr valign="bottom" height="160"><td align="center">
<a href="product_series_content.asp?id=<%=rs("id")%>">
<img src="<%=rs("ProImage")%>" border="0"/></a>
</td></tr></table></td>
<%end if
end if
rs.movenext
next %>
<%
rs.movenext
n=n+1
if n>rs.PageSize then exit do
loop
end if
%>
<tr>
<td style="padding-top:10px;" colspan="4">
<!-- #Include File="Include/SplitPage.Asp" -->
</td></tr>
<%rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</table>
[[it] 本帖最后由 assnpl 于 2008-11-4 11:20 编辑 [/it]]