asp分页函数
来源:互联网 发布:sql语言有两种使用方式 编辑:程序博客网 时间:2024/04/28 10:16
<% '输出页码信息
sub page_select() '首页 上一页 下一页 尾页 页面跳转选择
pageurl=Request.ServerVariables("SCRIPT_NAME") '取得当前文件名称
if page_now>1 then
response.Write "<a href="&PageUrl&"?page_now=1"&">首页</a>"
else
response.Write "首页"
end if
response.Write " "
if page_now>1 then
response.Write "<a href="&PageUrl&"?page_now="&page_now-1&">上一页</a>"
else
response.Write "上一页"
end if
response.Write " "
if page_now<page_total then
response.Write "<a href="&PageUrl&"?page_now="&page_now+1&">下一页</a>"
else
response.Write "下一页"
end if
response.Write " "
if page_now<page_total then
response.Write "<a href="&PageUrl&"?page_now="&page_total&">尾页</a>"
else
response.Write "尾页"
end if
response.Write " "
response.Write "第"&page_now&"页/共"&page_total&"页"
response.Write " "
tiao="跳到<select name='pageSelect' onChange='document.location=this.value'>"
for i=1 to page_total ' 跳转选择
If i=page_now Then
tiao=tiao&"<option value="&PageUrl&"?page_now="&i&" selected>"&i&"</option>"
Else
tiao=tiao&"<option value="&PageUrl&"?page_now="&i&">"&i&"</option>"
End If
Next
response.Write tiao
end sub
%>
<%
' -------------------------- 数据库分页简单例子-----------------------
set rs=server.CreateObject("Adodb.recordset")'
sql="select * from workname "
rs.open sql,conn,1,1
if not rs.bof and not rs.eof then
if request.QueryString("page_now")="" then
page_now=1
else
page_now=cint(request.QueryString("page_now"))
end if
page_size=3
rs.pagesize=page_size '每页的数目
page_total=rs.pagecount '共分成多少页
rs.absolutepage=page_now '当前页
dim i '------------- 输出控制
i=page_size
do while not rs.eof and i>0
i=i-1
%>
<% response.Write rs("workname")&"</br>" ' 循环体%>
<%
rs.movenext
loop '循环体
%>
<%
call page_select ' 页面选择输出
%>
<%
else '数据库为空
response.Write "数据库为空!"
end if
rs.close
set rs=nothing
%>
- ASP的分页函数
- ASP通用分页函数
- ASP分页函数
- asp分页函数
- ASP分页函数
- ASP通用分页函数
- 【asp】分页函数
- ASP分页函数
- asp数字分页函数
- ASP分页函数
- MS-SQL 分页函数+ASP
- 一个实用的ASP分页函数
- 对asp分页函数的修正!
- 我自己用的ASP分页函数
- asp 分页 函数 及调用 例子
- ASP版仿GOOGLE分页函数
- ASP.NET长文章分页显示函数
- ASP.NET长文章分页显示函数
- Jmail 发信代码!
- 设计模式--facade-结构型
- java随机验证码的生成
- AgileTeam成立
- asp.net学习资源列表
- asp分页函数
- ACE的安装,输出hello ace
- 关于datagrid超级链接列传参数到新的页面的方法求助
- Tomcat启动分析
- 防刷新计数器
- 某县政府网下载的文件变成灰鸽子 Backdoor.Win32.Hupigon.aku 了
- 编程方式的思考
- 主键表和外键表别搞混了
- 未来的操作系统