求一翻页代码(ASP)
谁能帮助我一下啊。我想要这样的ASP翻页代码。想这样123456显示页数。然后点击可以翻页。谢谢大家!petfly2004@163.com感谢ZHRX~...
谁能帮助我一下啊。我想要这样的ASP翻页代码。
想这样 1 2 3 4 5 6 显示页数。然后点击可以翻页。
谢谢大家!
petfly2004@163.com
感谢ZHRX~ 展开
想这样 1 2 3 4 5 6 显示页数。然后点击可以翻页。
谢谢大家!
petfly2004@163.com
感谢ZHRX~ 展开
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
邮箱?我把代码发给你,全部代码。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<p><%MaxPerPage=8 '定义页面最大的记录数为8<br>
if not isempty(request("page")) then <br>
currentPage=cint(request("page")) 'currentpage我们作为当前页面的变量,获得当前页的数值<br>
else<br>
currentPage=1 '如果为空就设为1<br>
end if<br>
sql="select * from article order by id desc" 'sql语句,查询article表中的所有数据<br>
Set rs= Server.CreateObject("ADODB.Recordset") <br>
rs.open sql,conn,1,1 '执行sql语句<br>
if rs.eof and rs.bof then <br>
response.write "<p align='center'> 还 没 有 任 何 文 章</p>" <br>
else <br>
totalPut=rs.recordcount '把查询到文章总数的值付给totalput变量(设置第一页)<br>
if currentpage<1 then '如果小于1<br>
currentpage=1 <br>
end if <br>
if (currentpage-1)*MaxPerPage>totalput then '设置最后一页,如果有溢出,计算页值<br>
if (totalPut mod MaxPerPage)=0 then <br>
currentpage= totalPut \ MaxPerPage <br>
else <br>
currentpage= totalPut \ MaxPerPage + 1 <br>
end if <br>
end if<br>
if currentPage=1 then '如果是第一页<br>
showpage totalput,MaxPerPage,"index.asp" '执行showpage函数,显示分页<br>
showContent '执行showContent函数,显示内容<br>
showpage totalput,MaxPerPage,"index.asp" '执行showpage函数,显示分页<br>
else '如果不是<br>
if (currentPage-1)*MaxPerPage<totalPut then '当前页*页面最大的记录数是否大于实际总记录数<br>
rs.move (currentPage-1)*MaxPerPage '把记录指针移到当前页的开头<br>
dim bookmark <br>
bookmark=rs.bookmark <br>
showpage totalput,MaxPerPage,"index.asp" <br>
showContent <br>
showpage totalput,MaxPerPage,"index.asp" <br>
else <br>
currentPage=1 <br>
showpage totalput,MaxPerPage,"index.asp" <br>
showContent <br>
showpage totalput,MaxPerPage,"index.asp" <br>
end if <br>
end if <br>
rs.close <br>
end if <br>
set rs=nothing <br>
%></p>
<p><%function showpage(totalnumber,maxperpage,filename) <br>
<br>
dim n <br>
if totalnumber mod maxperpage=0 then <br>
n= totalnumber \ maxperpage <br>
else <br>
n= totalnumber \ maxperpage+1 <br>
end if <br>
response.write "<form method=Post action="&filename&"?typeid="&typeid&">" <br>
response.write "<p align='center'>>>分页 " <br>
if CurrentPage<2 then <br>
response.write "<font color='999966'>首页 上一页</font> " <br>
else <br>
response.write "<a href="&filename&"?typeid="&typeid&"&page=1&>首页</a> " <br>
response.write "<a
href="&filename&"?typeid="&typeid&"&page="&CurrentPage-1&">上一页</a> " <br>
end if <br>
if n-currentpage<1 then <br>
response.write "<font color='999966'>下一页 尾页</font>" <br>
else <br>
response.write "<a href="&filename&"?typeid="&typeid&"&page="&(CurrentPage+1)
<br>
response.write ">下一页</a> <a
href="&filename&"?typeid="&typeid&"&page="&n&">尾页</a>" <br>
end if <br>
response.write " 页次:<strong><font
color=red>"&CurrentPage&"</font>/"&n&"</strong>页 " <br>
response.write " 共<b>"&totalnumber&"</b>个flash<b>"&maxperpage&"</b>个软件/页 "
<br>
response.write " 转到:<input type='text' name='page' size=4 maxlength=10
class=smallInput value="¤tpage&">" <br>
response.write "<input class=buttonface type='submit' value=' 确定 '
name='cndok'></span></p></form>" <br>
end function %></p>
if not isempty(request("page")) then <br>
currentPage=cint(request("page")) 'currentpage我们作为当前页面的变量,获得当前页的数值<br>
else<br>
currentPage=1 '如果为空就设为1<br>
end if<br>
sql="select * from article order by id desc" 'sql语句,查询article表中的所有数据<br>
Set rs= Server.CreateObject("ADODB.Recordset") <br>
rs.open sql,conn,1,1 '执行sql语句<br>
if rs.eof and rs.bof then <br>
response.write "<p align='center'> 还 没 有 任 何 文 章</p>" <br>
else <br>
totalPut=rs.recordcount '把查询到文章总数的值付给totalput变量(设置第一页)<br>
if currentpage<1 then '如果小于1<br>
currentpage=1 <br>
end if <br>
if (currentpage-1)*MaxPerPage>totalput then '设置最后一页,如果有溢出,计算页值<br>
if (totalPut mod MaxPerPage)=0 then <br>
currentpage= totalPut \ MaxPerPage <br>
else <br>
currentpage= totalPut \ MaxPerPage + 1 <br>
end if <br>
end if<br>
if currentPage=1 then '如果是第一页<br>
showpage totalput,MaxPerPage,"index.asp" '执行showpage函数,显示分页<br>
showContent '执行showContent函数,显示内容<br>
showpage totalput,MaxPerPage,"index.asp" '执行showpage函数,显示分页<br>
else '如果不是<br>
if (currentPage-1)*MaxPerPage<totalPut then '当前页*页面最大的记录数是否大于实际总记录数<br>
rs.move (currentPage-1)*MaxPerPage '把记录指针移到当前页的开头<br>
dim bookmark <br>
bookmark=rs.bookmark <br>
showpage totalput,MaxPerPage,"index.asp" <br>
showContent <br>
showpage totalput,MaxPerPage,"index.asp" <br>
else <br>
currentPage=1 <br>
showpage totalput,MaxPerPage,"index.asp" <br>
showContent <br>
showpage totalput,MaxPerPage,"index.asp" <br>
end if <br>
end if <br>
rs.close <br>
end if <br>
set rs=nothing <br>
%></p>
<p><%function showpage(totalnumber,maxperpage,filename) <br>
<br>
dim n <br>
if totalnumber mod maxperpage=0 then <br>
n= totalnumber \ maxperpage <br>
else <br>
n= totalnumber \ maxperpage+1 <br>
end if <br>
response.write "<form method=Post action="&filename&"?typeid="&typeid&">" <br>
response.write "<p align='center'>>>分页 " <br>
if CurrentPage<2 then <br>
response.write "<font color='999966'>首页 上一页</font> " <br>
else <br>
response.write "<a href="&filename&"?typeid="&typeid&"&page=1&>首页</a> " <br>
response.write "<a
href="&filename&"?typeid="&typeid&"&page="&CurrentPage-1&">上一页</a> " <br>
end if <br>
if n-currentpage<1 then <br>
response.write "<font color='999966'>下一页 尾页</font>" <br>
else <br>
response.write "<a href="&filename&"?typeid="&typeid&"&page="&(CurrentPage+1)
<br>
response.write ">下一页</a> <a
href="&filename&"?typeid="&typeid&"&page="&n&">尾页</a>" <br>
end if <br>
response.write " 页次:<strong><font
color=red>"&CurrentPage&"</font>/"&n&"</strong>页 " <br>
response.write " 共<b>"&totalnumber&"</b>个flash<b>"&maxperpage&"</b>个软件/页 "
<br>
response.write " 转到:<input type='text' name='page' size=4 maxlength=10
class=smallInput value="¤tpage&">" <br>
response.write "<input class=buttonface type='submit' value=' 确定 '
name='cndok'></span></p></form>" <br>
end function %></p>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询