您的位置:首页 > 编程语言

常用分页代码

2006-10-15 23:05 471 查看

暂时没有
共有[]条信息 分页 条/页 当前第页 首页 上页 上页 下页 下页 &Page=>尾页
<table width="564" border="0" cellspacing="0" cellpadding="0" >
<% sql="select * from tw where area='"&area2&"'order by id desc"
rs.open sql,cn,1,1
rs.pagesize=40
dim Page
Page =1
if request("Page") <> "" then
Page=cint(request("Page"))
end if
if not rs.eof and not rs.bof then
rs.absolutepage=Page
end if
count=rs.pagesize

if rs.recordcount=0 then
response.write ""
else
a=1
i=0
k=0
do while not rs.eof and count > 0

k=k+1
if k/2=int(k/2) then
bg="#ffffff"
else
bg="#FFF4F4"
end if
%>
<tr bgcolor="<%=bg%>" >
<td ><img src="images/readmore.gif" width="15" height="15"><a href="xianlu_content.asp?id=<% =rs("id") %>" target="_blank">  <%=rs("hy_rout")%></a>
</td>
</tr>
<%
rs.movenext
count=count-1
loop
%>
<tr>
<td width="100%" height="20" align="right" valign="middle" class="font">共有<font color="#FF2D00">[<%=rs.RecordCount%>]</font>条信息
分<font color="#FF2D00"><%=rs.pagecount%></font>页 <font color="#FF2D00"><%=rs.pagesize%></font>条/页
当前第<font color="#FF2D00"><%=Page%></font>页 <a href="?Class=<%=News_Class%>&Page=1">首页</a>
<%if Page>1 then%>
<a href="?Class=<%=News_Class%>&Page=<%=Page-1%>">上页</a>
<%else%>
上页
<%end if%>
<%if Page < rs.pagecount then %>
<a href="?Class=<%=News_Class%>&Page=<%=Page+1%>">下页</a>
<%else%>
下页
<%end if%>
<a href=?Class=<%=News_Class%>&Page=<%=rs.pagecount%>>尾页</a>
<%end if%>

</td>

</tr>
</table>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: