标题:请问下列框怎么样得出页数?
只看楼主
jack_young_007
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2005-6-9
得分:0 

------------------ pagelist.asp --------------------------- <% gotopage=request("gotopage") cpage=request("cpage") if gotopage<>"" then cpage=gotopage if not isempty(cpage) then if isnumeric(cpage) then cpage=CInt(cpage) else cpage=1 end if else cpage=1 end if set rs=Server.CreateObject("Adodb.Recordset") sql="select * from [数据表] order by 字段" '改成你自己的SQL语句

rs.open sql,conn,1,1 if rs.recordcount>0 then rowcount=25 '每页显示25条 rs.pagesize=rowcount if cpage<1 then cpage=1 elseif cpage>rs.pagecount then cpage=rs.pagecount end if rs.absolutepage=cpage if cpage=rs.pagecount then itemcount=rs.recordcount mod rowcount if itemcount=0 then itemcount=rowcount else itemcount=rowcount end if else itemcount=0 end if %> <html> <script> function ItemChange(ThisName) { location.href("pagelist.asp?cpage=" + ThisName.options[ThisName.selectedIndex].value) } </script> <select onchange="javascript:ItemChange(this)" name="gopage"> <%for i = 1 to rs.pagecount%> <option value="<%=i%>" <%if cpage=i then response.write "selected"%>>第<%=i%>页</option> <%next%> </select> </html>


2005-06-09 22:28



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-19962-1-1.html




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

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