分页就是会错
每次点下一页的时候就会错,感觉里面太乱,请高手帮我修正一下,我是新手<%
bigclass=request.QueryString("bigclass")
smallclass=request.QueryString("smallclass")
if smallclass="" then
set rs_small=server.createobject("adodb.recordset")
sqltext4="select * from smallclass_new where bigclassname='"&bigclass&"' order by idpx asc"
rs_small.open sqltext4,conn,1,1
smallclass=rs_small("smallclassname")
rs_small.close
set rs_small=nothing
end if
%>
<html>
<TITLE><%if smallclass="" then%><%=bigclass%><%else%><%=smallclass%><%end if%> - <%=SiteTitle%></TITLE>
<head>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name="description" content="<%=Sitedescription%>">
<meta name="keywords" content="<%=Sitekeywords%>">
<!-- #include file="Head.asp" -->
<table width="992" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images_pic/bg.jpg"><table width="972" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="208" align="left" valign="top"><table width="190" border="0" cellpadding="0" cellspacing="0" class="allp">
<tr>
<td height="30" class="left_lm"><%=bigclass%></td>
</tr>
<tr>
<td><%
set rs_news=server.createobject("adodb.recordset")
sqltext4="select * from smallclass_new where bigclassname='"&bigclass&"' order by idpx asc"
rs_news.open sqltext4,conn,1,1
do while not rs_news.EOF
%><a href="news.asp?bigclass=<%=server.URLEncode(rs_news("bigclassname"))%>&smallclass=<%=server.URLEncode(rs_news("smallclassname"))%>" class="leftnav<%if rs_news("smallclassname")=smallclass then%>_h<%end if%>"><%=rs_news("smallclassname")%></a>
<%
rs_news.MoveNext
loop
rs_news.close
set rs_news=nothing
%>
</td>
</tr>
</table>
<!-- #include file="left.asp" -->
</td>
<td width="764" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#e5e5e5"><span class="wz">您的当前位置:<a href="<%=SiteUrl%>" title="<%=SiteName%>" class="hui">首页</a> > <a href="news.asp?bigclass=<%=server.URLEncode(bigclass)%>" title="<%=bigclass%>" class="hui"><%=bigclass%></a> > <%=smallclass%></span><span class="fentitle"><%=smallclass%></span></td>
</tr>
<tr>
<td class="content"><table width="744" border="0" cellpadding="0" cellspacing="0">
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if BigClass<>"" and SmallClass <>"" then
sql="select * from news where BigClassName='"&BigClass&"' and SmallClassName='"&SmallClass&"' order by idpx desc"
rs.Open sql,conn,1,1
elseif BigClass<>"" then
sql="select * from news where BigClassName='"&BigClass&"' order by idpx desc"
rs.Open sql,conn,1,1
end if
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<%
rs.PageSize=15
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<tr>
<td width="23" height="35" align="center" class="downxu" ><span class="downdian"><img src="images_pic/biaod.gif" width="4" height="6" /></span></td>
<td width="589" class="downxu"><a href="info.asp?id=<%= RS("id") %>" title="<%=rs("title")%>" class="font14px" style="<%if rs("color1")<>"" then%>color:<%=rs("color1")%>;<%end if%><%if rs("ztcu")="1" then%>font-weight: bold;<%end if%>"><%=rs("title")%></a></td>
<td width="132" align="right" class="downxu"><font class="adddate"><%=FormatDateTime(RS("AddDate"),2)%></font></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
<tr valign="bottom">
<td height="50" colspan="3" align="right" ><form method="post" action="news.asp?BigClass=<%=BigClass%>&SmallClass=<%=SmallClass%>">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=news.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=1>首页</a> "
response.write "<a href=news.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=news.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=" & (page+1) & ">"
response.write "下一页</a> <a href=news.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=3 maxlength=5 class=input value="&page&">"
response.write " <input class=input type='submit' value='Go' name='cndok'></span></p>"
%>
</form></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>