用Dreamweaver做网页怎么弄“下一页”??

例如:

很简单的
<%on error resume next
set rs=server.createobject("adodb.recordset")
sqlp="select * from 你要查询的表名 order by id desc"
rs.open sqlp,Conn,1,1
if rs.eof and rs.bof then
response.write"暂时没有内容"
err.clear
end if
rs.pagesize=20 '设定每页显示条数
if request("pageno")<>"" then
pageno=cint(request("pageno"))
if pageno<1 then pageno=1
if pageno>rs.pagecount then pageno=rs.pagecount
else
pageno=1
end if
rs.absolutepage=pageno
%>
<table width="640" border="0" cellpadding="0" cellspacing="0">
<tr> <td align="center" valign="top"><table width="95%" border="0" cellpadding="0" cellspacing="0" class="css004">
<tr>
<td><table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr><%
for i=1 to rs.pagesize
if rs.bof or rs.eof then exit for
%>

<td align="center"><%=rs("你要查询的字段")%></td>
<%
if i mod 5=0 then '设定每行显示条数
response.Write("</tr><tr>")
end if
%><%
rs.movenext()
Next
%>
</table>
<table width="100%" height="21" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="41%"><table width="100%" height="12" border="0" cellpadding="0" cellspacing="0">
</table></td>
<td width="59%">
<div class="green-black">
<%
pagenum=rs.pagecount
pageno=1
if request.QueryString("pageno")<>"" then
pageno=cint(request.QueryString("pageno"))
end if
'显示数量设定
showpagenum= 5
'上一页显示判断
if pageno>1 then
response.write "<span class=""disabled""> <a href='?pageno="&pageno-1&"'>< 首页</a></span> "
'response.end()
end if
if pagenum>showpagenum then
num_left=pageno-1
num_right=pagenum-pageno
if num_left>(showpagenum/2) then
if num_right<(showpagenum/2) then
page_left=pageno-(showpagenum-num_right)+1
page_right=pagenum
else
page_left=pageno-(showpagenum/2)
page_right=pageno+(showpagenum/2)
end if
else
page_left=1
page_right=pageno+(showpagenum-num_left)-1
end if
'前项输出
for P=page_left to pageno-1
response.write " <a href='?pageno="&p&"'>["&p&"]</a> "
next
'当前项输出
response.write " <span class=""current"">"&pageno&"</span> "
'后项输出
for f=pageno+1 to page_right
response.write " <a href='?pageno="&f&"'>["&f&"]</a> "
next
else
for i=1 to pagenum
if i=pageno then
response.write " <span class=""current"">["&i&"]</span> "
'response.end()
else
response.write " <a href='?pageno="&i&"'>["&i&"]</a> "
'response.end()
end if
next
end if
'最后一页判断
if pageno<pagenum then
response.write " <a href='?pageno="&i+1&"'>最后一页 > </a> "
'response.end()
end if
%></div></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>

如果还看不明白就加百度hi
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网