| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 661 人关注过本帖
标题:[求助]求好用的翻页函数(带页码)
只看楼主 加入收藏
qskm
Rank: 1
等 级:新手上路
帖 子:53
专家分:0
注 册:2006-4-12
收藏
 问题点数:0 回复次数:3 
[求助]求好用的翻页函数(带页码)
大家好!

哪位帅哥有好用的翻页函数呀? 一定要带页码的,网上虽然有挺多,发现都不怎么好用啊,所以求一个了.
搜索更多相关主题的帖子: 页码 函数 
2007-09-26 16:44
hmhz
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:30
帖 子:1890
专家分:503
注 册:2006-12-17
收藏
得分:0 

<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from book order by id desc",conn,1,1

page=request.querystring("page")
if page="" then
page=1
end if
pages = "25"
rs.pagesize = pages
if not(rs.eof or rs.bof) then
maxpagecount=rs.pagecount
rs.absolutepage = page
i=0
pagestart=page-9
pageend=page+9
if pagestart<1 then
pagestart=1
end if
if pageend>maxpagecount then
pageend=maxpagecount
end if
rcount=rs.RecordCount
do while not rs.eof and i <rs.pagesize
%>
………………………………
<%
rs.movenext
i=i+1
loop
rs.close
set rs=nothing
%>


<a href="?page=1"><span style="font-family:Webdings;">7</span></a>
<%
for i=pagestart to pageend
if i=0 then i=1 end if
response.write " <a href=""?page="&i&""">"&i&"</a> "
next
%>
<a href="?page=<%=maxpagecount%>"><span style="font-family:Webdings;">8</span></a> 第<font color="red"><%=page%></font>页 共<font color="red"><%=maxpagecount%></font>页 每页<font color="red"><%=pages%></font>条 共<font color="red"><%=rcount%></font>条


[编程论坛] ASP超级群:49158383  敲门暗号:ASP编程
龍艺博客 http://www.
2007-09-26 17:21
中国男孩
Rank: 1
等 级:新手上路
帖 子:291
专家分:7
注 册:2006-3-19
收藏
得分:0 

<%
if IsNumeric(request.querystring("dch_page"))=false then
response.write "出错啦,对不起没有你要找的那一页!"
response.end
end if
%>
<!--#Include File="cw_top.asp"-->
<!--#Include file="linkdatamdb.asp"-->
<%
set cwrs=server.createobject("ADODB.Recordset")
cwsql="select * from cw_data Order By id DESC"
cwrs.open cwsql,cwconn,1,1

if not cwrs.bof and not cwrs.eof then
if request.querystring("dch_page")="" then
dch_page=1
else
dch_page=clng(request.querystring("dch_page"))
end if
cwrs.pagesize=2
cwrs.AbsolutePage=dch_page
if dch_page>cwrs.pagecount then
response.write "出错啦,对不起没有你要找的那一页!"
response.end
else

%>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
</head>

<div align="center">
<table border="0" width="768" cellpadding="0" style="border-collapse: collapse" id="table1">
<tr>
<td>
<table border="0" width="100%" cellpadding="3" id="table2">
<tr>
<td>
<table border="0" width="100%" style="border-collapse: collapse" id="table3">
<tr>
<form method="get" name="searh1" action="searh.asp">
<script language="vbscript">
function searh1_onsubmit()
if len(trim(window.document.searh1.t1.value))<2 then
msgbox("请输入要查的值!"),4+24,"提示"
window.document.searh1.t1.focus():
searh1_onsubmit=false
exit function
end if
if len(trim(window.document.searh1.t2.value))<1 then
msgbox("请输入要查的值!"),2+24,"提示"
window.document.searh1.t2.focus():
searh1_onsubmit=false
exit function
end if
end function
</script>
<td width="247">从<input type="text" name="t1" size="11">到<input type="text" name="t2" size="13"></td>
<td width="52"><select size="1" name="select1">
<option value="jj">进价</option>
<option value="ly">利润</option>
<option value="csj">出售价</option>
<option value="year">时间</option>
</select></td>
<td width="69">
<input type="submit" value="给我查" name="B2"></td>
</form>
<td width="59">关键字:</td>
<form method="get" action="searh.asp" name="searh2">
<script language="vbscript">
function searh2_onsubmit()
if len(trim(window.document.searh2.t3.value))<1 then
msgbox("请输入要查的值!"),4+24,"提示"
window.document.searh2.t3.focus():
searh2_onsubmit=false
exit function
end if
end function
</script>
<td><input type="text" name="t3" size="20"></td>
<td width="52"><select size="1" name="select2">
<option value="jj">进价</option>
<option value="csj">出售</option>
<option value="ly">利润</option>
<option value="ymd">时间</option>
<option value="address">地址</option>
<option value="zb">注备</option>
</select></td>
<td width="57">
<input type="submit" value="给我查" name="B1"></td>
</form>
<td width="58"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" id="table4" style="border-collapse: collapse" bgcolor="#0066FF" cellpadding="0">
<tr>
<td>
<table border="1" width="100%" style="border-collapse: collapse" id="table5" height="26" bordercolor="#FFFFFF">
<tr>
<td width="82" align="center">进价</td>
<td width="93" align="center">出售价</td>
<td width="93" align="center">利润</td>
<td align="center">时间</td>
<td width="144" align="center">拿货地址</td>
<td width="192" align="center">注备</td>
</tr>
</table>
</td>
</tr>


<tr>
<td>
<table border="1" width="100%" style="border-collapse: collapse" id="table6" bordercolor="#FFFFFF">
<%for cw=1 to cwrs.pagesize
if cwrs.bof or cwrs.eof then exit for
%>
<tr>
<td width="82">
<p align="right"><b><font size="2"><%=cwrs("jj")%>¥</font></b></td>
<td width="93">
<p align="right"><b><font size="2"><%=cwrs("csj")%>¥</font></b></td>
<td width="93">
<p align="right"><b><font size="2"><%=cwrs("ly")%>¥</font></b></td>
<td width="135"><%=cwrs("year")%><%=cwrs("month")%><%=cwrs("day")%></td>
<form method="POST" action="">
<td>
<p align="center">
<textarea rows="1" name="S1" cols="13" style="border: 1px solid #0066FF; padding: 0; background-color:#0066FF"><%=cwrs("hour")%><%=cwrs("address")%></textarea></td>
<td width="192">
<p align="center">
<textarea rows="1" name="S2" cols="18" style="border: 1px solid #0066FF; background-color:#0066FF; padding-left:1px; padding-right:0; padding-top:0; padding-bottom:0"><%=cwrs("bz")%></textarea></td>
</form>
</tr>
<%
cwrs.movenext
next
end if
%>

</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div align="center">
<table border="0" width="768" cellpadding="0" style="border-collapse: collapse" id="table7">
<tr>
<td>
<p align="center">
<%="共"%><%=cwrs.recordcount%><%="条" &"&nbsp;&nbsp;"%>
<%
for b=1 to cwrs.pagecount
if b=dch_page then
response.write b &"&nbsp"
else
response.write "<a href='show_data.asp?dch_page="&b&"'>"&b&" </a>&nbsp"
end if
if b mod 16=0 then response.write "<br>"
next
%>
<%="&nbsp;&nbsp;"%><%="共"%><%=cwrs.pagecount%><%="页"%><%="当前"%><%response.write "/"%><%=dch_page%><%="页"%>
<select size="1" name="select" onchange="javascript:location=this.options[this.selectedIndex].value;">
<option value="第<%=dch_page%>页">第<%=dch_page%>页</option>
<%
for dch=1 to cwrs.pagecount
if dch<>dch_page then
%>
<option value="show_data.asp?dch_page=<%=dch%>">第<%=dch%>页</option>
<%
end if
next
end if
%>

</select></td>
</tr>
</table>
</div>
</div>


我很想把计算机学好!!
2007-09-26 17:34
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
http://bbs.bc-cn.net/viewthread.php?tid=37557&star=at
楼主提问题之前先看一看精华帖子里是否有已经解决了的相关问题。
2007-09-26 17:38
快速回复:[求助]求好用的翻页函数(带页码)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023642 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved