求高手解释!!ASP翻页功能
时间:2011-12-09
来源:互联网
<%
dim strFileName
const MaxPerPage=2
dim totalPut,CurrentPage,TotalPages
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
strFileName="show.asp?B.Username="&B.Username&"&"&"A.Content="&A.Content&"&"&"A.Scoring="&A.Scoring&"&"&"A.Date="&A.Date&""'页面的设置!-提示
%>
<%
the_class=1 '开通
'查询语句开始
sql="SELECT B.Username, A.Scoring, A.Content, A.Date FROM [Comments] AS A, [User] AS B WHERE A.UserID = B.UserID AND A.Checked = 1"
if B.Username<>"" then
sql=sql&" and name like'%"&B.Username&"%'"
end if
if A.Scoring <> "" then
sql=sql&" and star = " & A.Scoring & ""
end if
if A.Content<>"" then
sql=sql&" and city="&A.Content&""
end if
if A.Date<>"" then
sql=sql&" and info like'%"&A.Date&"%'"
end if
'价格区域
sql=sql
set rs=server.CreateObject("ADODB.recordset")
rs.open sql,conn,1,1
totalPut=rs.recordcount
if rs.eof and rs.bof then
response.write "<div align=center><p><font color=red><--暂无任何信息--></font></p></div>"
else
%>
<%
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
else
currentPage=1
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
end if
end if
rs.close
set rs=nothing %>
<%sub showContent
dim page_Num
page_Num=0%>
<%
do while not rs.eof
我这个页面的设置,路径要怎么写?
dim strFileName
const MaxPerPage=2
dim totalPut,CurrentPage,TotalPages
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
strFileName="show.asp?B.Username="&B.Username&"&"&"A.Content="&A.Content&"&"&"A.Scoring="&A.Scoring&"&"&"A.Date="&A.Date&""'页面的设置!-提示
%>
<%
the_class=1 '开通
'查询语句开始
sql="SELECT B.Username, A.Scoring, A.Content, A.Date FROM [Comments] AS A, [User] AS B WHERE A.UserID = B.UserID AND A.Checked = 1"
if B.Username<>"" then
sql=sql&" and name like'%"&B.Username&"%'"
end if
if A.Scoring <> "" then
sql=sql&" and star = " & A.Scoring & ""
end if
if A.Content<>"" then
sql=sql&" and city="&A.Content&""
end if
if A.Date<>"" then
sql=sql&" and info like'%"&A.Date&"%'"
end if
'价格区域
sql=sql
set rs=server.CreateObject("ADODB.recordset")
rs.open sql,conn,1,1
totalPut=rs.recordcount
if rs.eof and rs.bof then
response.write "<div align=center><p><font color=red><--暂无任何信息--></font></p></div>"
else
%>
<%
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
else
currentPage=1
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"条信息"
end if
end if
rs.close
set rs=nothing %>
<%sub showContent
dim page_Num
page_Num=0%>
<%
do while not rs.eof
我这个页面的设置,路径要怎么写?
作者: boyuan168 发布时间: 2011-12-09
你就正常写你的链接 只不过在本页分页的时候下一页和上一页的时候你要传递参数
分页代码:http://www.cnblogs.com/ShineTan/archive/2006/02/24/336867.html
分页代码:http://www.cnblogs.com/ShineTan/archive/2006/02/24/336867.html
作者: hefeng_aspnet 发布时间: 2011-12-09
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28