我想问个asp翻页的问题

来源:百度知道 编辑:UC知道 时间:2024/07/03 04:47:12
<%
set rs=Server.CreateObject("Adodb.Recordset")
rs.open "select * from news",conn,1,1

rs.pagesize=3
curpage=1

if not isEmpty(request("curpage")) then
curpage=CInt(request("curpage"))
end if
if curpage>rs.pagecount then
curpage=rs.pagecount
end if
if curpage<=0 or curpage="" then
curpage=1
end if
rs.absolutepage=curpage
nextpage=curpage+1
previouspage=curpage-1

i=1
while not rs.eof and i<=rs.pagesize

%>
<tr>

<td><%=rs("ID")%></td>
<td><%=rs("Title")%></td>
<td><%=rs("UName")%></td>
<td><%=rs("Due")%></td>
<td><%=rs("PubDate")%></td>
<%
rs.movenext
i=i+1
wend

悄悄的告诉你:
<a href="Manage_News.asp?curapge=<%=nextpage%>">后一页</a>
写错了
curapge应该是curpage

我倒,我有代码。
你有邮箱吧,我发过去。

<a href="Manage_News.asp?curpage=1">首页</a>
<a href="Manage_News.asp?.asp?curpage=<%=previouspage%>">上一页</a>
<a href="Manage_News.asp?.asp?curpage=<%=nextpage%>">下一页</a>
<a href="Manage_News.asp?.asp?curpage=<%=rs.pagecount%>">