社区
ASP
帖子详情
在ASP中数据较多时怎样实现分页显示?
ask999
2003-11-10 11:35:35
如题,请给出完整代码.谢谢
...全文
32
6
打赏
收藏
在ASP中数据较多时怎样实现分页显示?
如题,请给出完整代码.谢谢
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
blueice2002
2003-11-10
打赏
举报
回复
http://expert.csdn.net/Expert/topic/2437/2437534.xml?temp=.4696009
junsisi
2003-11-10
打赏
举报
回复
http://www.5ienet.com/guestbook/default.asp
看看这个,下头有源码的下载
俺自已觉着这个是俺写过的最好的分页代码~~
aimei2003
2003-11-10
打赏
举报
回复
1。
<%
function showpage(totalnumber,maxperpage,filename)
Response.Write("<tr><td><br>")
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
if n<=1 then exit function
response.write "<p align='center'> "
if CurrentPage<2 then
response.write "<font color='#000080'>首页 上一页</font> "
else
response.write "<a href="&filename&"?page=1&fid="& fid & "&sid=" & sid & "&tid=" & tid &">首页</a> "
response.write "<a href="&filename&"?page="¤tPage-1&"&fid="& fid & "&sid=" & sid & "&tid=" & tid & ">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='#000080'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="& (CurrentPage+1) & "&fid=" & fid & "&sid=" & sid & "&tid=" & tid&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&fid="& fid & "&sid=" & sid & "&tid=" & tid &">尾页</a>"
end if
response.write "<font color='#000080'> 页次:</font><strong><font color=red>"¤tPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
response.write "<font color='#000080'> 共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>篇文章/页</font> "
' response.write " <font color='#000080'>转到:</font><input type='text' name='page' size=4 maxlength=10 class=smallInput value="¤tpage&">"
response.write "</span></p>"
Response.Write("</td></tr>")
end function
%>
2。
<% dim page,totle,no,n,ye
totle=0
n=20
pagesize=n
page=request("no")
no=rs.absolutepage
rs.movefirst
do while not rs.eof
totle=totle+1
rs.movenext
loop
ye=int(totle/n*-1)*-1
if page<1 then
page=1
end if%>
<% rs.movefirst
rs.move((page-1)*20)
y=((page-1)*20)
while y<((page-1)*20)+20 and y<totle
%>
<table border="0" width="750" bgcolor="">
<td bgcolor="#FFFFCC">
<font size="3" color="#3300FF"><b><img src="dafeiliu/<%=rs("image")%>" alt="个性头像">留言者:<font size="4" color="#FF00CC"><%=rs("name")%></font>:于<%=rs("time")%>,<font size="4" color="#FF0000">Email:<a href="mailto:<%=rs("email")%>"></font></b><img src="pic/gif1/mail.gif" width="40" height="32" border="2" alt="信箱"></font></a> <a href="<%=rs("page")%>" target="_blank"><img src="pic/gif1/page.gif" width="40" height="32" border="0" alt=""></a>
<p><font size="4" color="#FF00CC"><%=rs("name")%></font>的留言是:<br>
<table border="2" bordercolor="#FF0066">
<tr>
<td width="750" height="80"><%=rs("word")%></td>
</tr>
</table>
</p>
</table>
<% rs.movenext
y=y+1
wend
rs.close %><br>
<%response.write"<a href=dafei3.asp?no="&page-1&"><font size=3 color=#CCCC66>上一页</font></a>"%>共有留言<font size="4" color="#FF0000"><%=totle%></font>条 <font size="4" color="#FF66FF"><%=ye%></font>页 当前是第<font size="4" color="#33FF33"><%=page%></font>页
<%response.write"<a href=dafei3.asp?no="&page+1&"><font size=3 color=#FF00FF>下一页</font></a>"%><p>
DBApower
2003-11-10
打赏
举报
回复
我这里我多个最简单的分页
并且有我写的最简单的分页
比起网上写的繁杂的难理解的分页不止要好多少倍
your e-mail is?
MY e-mail : seeyouknowme@163.com
popcode
2003-11-10
打赏
举报
回复
搜索一下,多的是!!!
PS:自己动手丰衣足食!
ask999
2003-11-10
打赏
举报
回复
谢谢seeyouc()!
我的MAIL: ydj@ynadult.com
ASP
.net
中
大结果集的
分页
在Web应用程序
中
,对一个大
数据
库结果集进行
分页
已经是一个家喻户晓的问题了。简单的说, 你不希望所有的查询
数据
显示
在一个单独的页面
中
,所以带有
分页
的
显示
才是更合适的。虽然在 传统的
asp
里这并不是一个简单的任务,但在
asp
.net
中
,DataGrid控件把这一过程简化为只有 几行代码。因此,在
asp
.net
中
,
分页
很简单,但是默认的DataGrid
分页
事件会从
数据
库
中
把所 有的记录全部读出来放到
asp
.net web应用程序
中
。当你的
数据
在一百万以上的时候,这将引起 严重的性能问题(如果你不相信,你可以在你的应用程序
中
执行一个查询,然后在任务管理器
中
查看
asp
net_wp.exe的内存消耗情况)这也就是为什么需要自定义
分页
行为,这样可以保证仅 获得当前页需要的
数据
记录。 在网上有很多关于这个问题的文章和帖子,还有一些成熟的解决方案。我写这篇文章的目的不是 向你展示一个可以解决一切问题的存储过程,而是出于优化已有方法,同时为你提供一个可供测 试的应用程序,这样你就可以根据自己的需要进行开发。下文是一个很好的开始,它包含了很多 不同的方法,并且给出了一些性能测试结果
.net
分页
asp
.net
分页
.net
分页
asp
.net
分页
asp
.net文章
分页
asp
.net文章
分页
:当我们的新闻字数很多的时候,想要
分页
怎么办?本项目里就有全部的方法
js
分页
实例
asp
服务端
关于js
分页
的实例,
asp
服务端返回
数据
!
asp
数据
控件
分页
技术
各种
数据
控件的
分页
,很全的,使用时直接将源码复制粘贴,稍作改动即可...
ASP
28,409
社区成员
356,971
社区内容
发帖
与我相关
我的任务
ASP
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
复制链接
扫一扫
分享
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章