文章·资料 电脑软件 手机软件 网站源码




    本 站 搜 索
   推 荐 文 章        More...
华硕易电脑(ASUS Eee PC 10..
先来段开场白:为了外出携带方便..
Acronis True Image 使用..
  一款可以在Windows下使用..
Norton Ghost 使用详解
一、分区备份   使用Ghost..
    文 章 阅 读 排 行
世界各国所使用的国际域名..
域名缩写 国家/地区 ..
关于 Firefox 在中国持续..
亲爱的 Firefox 用户及 Firefox..
全国各地、公共 DNS 服务器
排序 地区/公司名称 ..
Microsoft SQL Server 2000..
  对于第一次安装 Microsoft ..
Windows 系统安装或备份时 ..
【ISO 文件】 ISO 文件其实..
Windows PE 系统安装微软..
如果电脑没有光驱,或者没有把..
ASP 网页编码 GB2312 转换..
1、用记事本打开文件(如果整站..
腾讯:难以承受之痛的背后..
亲爱的网吧管理员:   在此,..
SATA 硬盘分区设置与安装..
  随着i865、i875、KT600等..
Windows XP 安装界面修改..
安装装界面----也就是安装复制..
 文 章 信 息
ASP分页函数
评论()〗〖留言〗〖收藏
〖文章分类:电脑·手机·网络 / 网站设计·开发·优化〗〖阅读选项
<%
Function ExportPageInfo(ByRef rs,curpage,i,LinkFile)
Dim retval, j, pageNumber, BasePage
retval = "第" & curpage & "页/总" & rs.pagecount & "页 " 
retval = retval & "本页" & i & "条/总" & rs.recordcount & "条 "
If curpage = 1 Then 
retval = retval & "首页 前页 " 
Else 
retval = retval & "<a href=’’" & LinkFile & "page=1’’>首页</a> <a href=’’" & LinkFile & "page=" & cstr(curpage - 1) & "’’>前页</a> " 
End If
If curpage = rs.pagecount Then 
retval = retval & "后页 末页"
Else
retval = retval & "<a href=’’" & LinkFile & "page=" & cstr(curpage + 1) & "’’>后页</a> <a href=’’" & LinkFile & "page=" & cstr(rs.pagecount) & "’’>末页</a>"
End if
retval = retval & "<br/>"
BasePage = (curpage \ 10) * 10
If BasePage > 0 Then retval = retval & " <a href=’’" & LinkFile & "page=" & (BasePage - 9) & "’’><<</a>"
For j = 1 to 10
pageNumber = BasePage + j
If PageNumber > rs.pagecount Then Exit For
If pageNumber = Cint(curpage) Then
retval = retval & " <font color=’’#FF0000’’>" & pageNumber & "</font>"
Else
retval = retval & " <a href=’’" & LinkFile & "page=" & pageNumber & "’’>" & pageNumber & "</a>"
End If
Next
If rs.pagecount > BasePage Then retval = retval & " <a href=’’" & LinkFile & "page=" & (BasePage + 11) & "’’>>></a>"
ExportPageInfo = retval
End Function

 

应用
<%
adoPageRS.open "SELECT * FROM news ORDER BY addtime DESC", conn, 1, 1
if err.number <> 0 then
response.write "数据库操作失败:"&err.description
else
if adoPageRS.eof and adoPageRS.bof then
response.write "没有记录"
else
%>
<div align="center"> 
<center>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr class="big"> 
<td width="60%">新 闻 标 题</td>
<td width="25%" align="center">日期</td>
<td width="15%" align="center">操  作</td>
</tr>
<% 
adoPageRS.pagesize = 10 
adoPageRS.absolutepage = curpage 
for i = 0 to 9 
%>
<tr> 
<td><%= adoPageRS("title") %></td>
<td align="center"> 
<% = adoPageRS("addtime") %>
</td>
<td align="center"><a href=’’newsman.asp?action=edit&id=<%= adoPageRS("id")%>’’>编辑</a> 
<a href=’’javascript:confirmDel(<%= adoPageRS("id") %>)’’>删除</a></td>
</tr>
<% 
adoPageRS.movenext 
if adoPageRS.eof then
i = i + 1
exit for
End If
next
%>
<tr align="center"> 
<td colspan="3"> 
<% = ExportPageInfo(adoPageRS, curpage, i, "Newsman.asp?") %>
</td>
</tr>
</table>
</center>
</div>

文章作者:未知  更新日期:2008-03-07
〖文章浏览:〗〖发送文章〗〖打印文章