急!!!ASP翻页代码无效,点了第二页但是还是停留在第一页,帮下忙看看怎么回事!只能显示第一页的!
<%rs.PageSize=5'设置每页显示记录个数ifpage=0thenpage=1pages=rs.pagecount'response.write(rs.Page...
<%
rs.PageSize=5 '设置每页显示记录个数
if page=0 then page=1
pages=rs.pagecount
'response.write(rs.PageSize&"-"&rs.pagecount&"-"&page)
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
newdate=FormatDateTime(RS("Riqi"),2)
%>
-------------------------------------这是前面设置的每五条为一页,下面的是翻页代码
<%
rs.movenext
if rs.eof then exit for
next
%>
<tr valign="bottom">
<td colspan="4" align="center" ><form method="post" action="ActivityClass.asp?BigClass=<%=BigClass%>">
<div align="right">
<div align="right">
<%if rs.pagecount>1 then
response.write "<font size=2>页数 "&page&"/"&rs.pagecount
strTemp=" 跳转 <select name='page' size='1' onchange='javascript:submit()' style='font-size:11px'>"
for i=1 to rs.pagecount
strTemp=strTemp & "<option value='" & i & "'"
if page=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">" & i & "</option>"
next
strTemp=strTemp & "</select></font>"
response.Write(strTemp)
'______________1,2,3,4 方式分页_________________________________
'response.write "<a href=NewsClass.asp?BigClass="&GetUrlParm(BigClass)&"&SmallClass="&SmallClass&"&page=1>Home</a> " //首页
'dim PageSizeCount '显示页个数
' dim CurrentPageFirst
' CurrentPageFirst=Page
' PageSizeCount=5 '设置个数
' PageSizeCount=CurrentPageFirst+PageSizeCount-1
' if PageSizeCount>rs.pagecount then
' CurrentPageFirst=rs.pagecount-PageSizeCount
' PageSizeCount=rs.pagecount
' end if
' if CurrentPageFirst<=0 then CurrentPageFirst=1
' for i=CurrentPageFirst to PageSizeCount
' response.write "<a href=NewsClass.asp?BigClass="&GetUrlParm(BigClass)&"&SmallClass="&SmallClass&"&page=" & i & ">"& i &"</a> "
' next
'response.write "<a href=NewsClass.asp?BigClass="&GetUrlParm(BigClass)&"&SmallClass="&SmallClass&"&page="&rs.pagecount&">Last</a>" //最后一页
'response.write " Turn To:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
'response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
'_____________________________________________________---
end if
%>
</div>
</div>
</form></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
------------------------------用的是第一种翻页方式,但是两种都翻不了,只停留在第一页,求高手帮忙啊!急!! 展开
rs.PageSize=5 '设置每页显示记录个数
if page=0 then page=1
pages=rs.pagecount
'response.write(rs.PageSize&"-"&rs.pagecount&"-"&page)
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
newdate=FormatDateTime(RS("Riqi"),2)
%>
-------------------------------------这是前面设置的每五条为一页,下面的是翻页代码
<%
rs.movenext
if rs.eof then exit for
next
%>
<tr valign="bottom">
<td colspan="4" align="center" ><form method="post" action="ActivityClass.asp?BigClass=<%=BigClass%>">
<div align="right">
<div align="right">
<%if rs.pagecount>1 then
response.write "<font size=2>页数 "&page&"/"&rs.pagecount
strTemp=" 跳转 <select name='page' size='1' onchange='javascript:submit()' style='font-size:11px'>"
for i=1 to rs.pagecount
strTemp=strTemp & "<option value='" & i & "'"
if page=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">" & i & "</option>"
next
strTemp=strTemp & "</select></font>"
response.Write(strTemp)
'______________1,2,3,4 方式分页_________________________________
'response.write "<a href=NewsClass.asp?BigClass="&GetUrlParm(BigClass)&"&SmallClass="&SmallClass&"&page=1>Home</a> " //首页
'dim PageSizeCount '显示页个数
' dim CurrentPageFirst
' CurrentPageFirst=Page
' PageSizeCount=5 '设置个数
' PageSizeCount=CurrentPageFirst+PageSizeCount-1
' if PageSizeCount>rs.pagecount then
' CurrentPageFirst=rs.pagecount-PageSizeCount
' PageSizeCount=rs.pagecount
' end if
' if CurrentPageFirst<=0 then CurrentPageFirst=1
' for i=CurrentPageFirst to PageSizeCount
' response.write "<a href=NewsClass.asp?BigClass="&GetUrlParm(BigClass)&"&SmallClass="&SmallClass&"&page=" & i & ">"& i &"</a> "
' next
'response.write "<a href=NewsClass.asp?BigClass="&GetUrlParm(BigClass)&"&SmallClass="&SmallClass&"&page="&rs.pagecount&">Last</a>" //最后一页
'response.write " Turn To:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
'response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
'_____________________________________________________---
end if
%>
</div>
</div>
</form></td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
------------------------------用的是第一种翻页方式,但是两种都翻不了,只停留在第一页,求高手帮忙啊!急!! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询