谁有asp分页函数, 给小弟贴一个, 谢过了

fristfly 2004-11-26 10:39:03
谁有asp分页函数
...全文
232 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
ggg9 2004-11-27
  • 打赏
  • 举报
回复
就是,有多惊人?贴出来看看!
hj3793 2004-11-26
  • 打赏
  • 举报
回复
up
hfjfboy 2004-11-26
  • 打赏
  • 举报
回复
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'╔-------------------------------------------------╗
'┆COPYRIGHT: hfjfboy ┆
'┆QQ: 12172783 ┆
'┆EMAIL: hfjfboy@etang.com ┆
'┆DATE: 2004/5/30 ┆
'╚-------------------------------------------------╝
%>
<!--#include file="conn.asp" -->
<!--#include file="../inc/quan.asp" -->
<!--#include file="../inc/session_check.asp" -->
<%
quan("sale_manage/list.asp")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
td { font-size: 9pt}
a { color: #000000; text-decoration: none}
a:hover { text-decoration: underline}
-->
</style>

</head>

<body leftmargin="0" marginwidth="0" marginheight="0">
<center>
<table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
<tr>
<td><table width="600" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="60" height="25" align="center" bgcolor="#FFFFFF"><strong>房屋状态</strong></td>
<td width="60" align="center" bgcolor="#FFFFFF"><strong>房屋编号</strong></td>
<td width="70" align="center" bgcolor="#FFFFFF"><strong>产权证编号<br>
</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>房屋位置</strong></td>
<td width="60" align="center" bgcolor="#FFFFFF"><strong>面积</strong></td>
<td width="40" align="center" bgcolor="#FFFFFF"><strong>售价</strong></td>
</tr>
<%
dim rs,sql,a
set rs=server.CreateObject("adodb.recordset")
sql="select * from sale order by id desc"
rs.open sql,conn,1,1
rs.PageSize=28
dim total,PageNo '页数
PageNo=request("PageNo")
total=int(rs.recordcount / rs.PageSize * -1)*-1 '计算可显示页面的总数

dim ScrollAction '上一页,下一页操作符
ScrollAction = Request("ScrollAction")
if ScrollAction = "首页" Then PageNo=1
if ScrollAction = "上一页" Then PageNo=PageNo-1
if ScrollAction = "下一页" Then PageNo=PageNo+1
if ScrollAction = "尾页" Then PageNo=total

if PageNo < 1 Then PageNo = 1
if PageNo > total then PageNo = total

rs.AbsolutePage = PageNo

position=rs.PageSize*PageNo
pagebegin=position-rs.PageSize+1
if position < rs.RecordCount then
pagend=position
else
pagend= rs.RecordCount
end if

RowCount = rs.PageSize
do while not rs.eof
%>
<tr onclick="location.href='show.asp?id=<%=rs("id")%>';" style="cursor:hand;">
<td height="22" align="center" bgcolor="#FFFFFF"><font color="#0000FF">
<%
fettle=rs("fettle")
select case fettle
case "作废"
response.Write("<img src=../images/sale1.gif width=10 height=11 align=absmiddle>"&fettle)
case "已售"
response.Write("<img src=../images/sale3.gif width=10 height=11 align=absmiddle>"&fettle)
case else
response.Write("<img src=../images/sale2.gif width=10 height=11 align=absmiddle>"&fettle)
end select
%>
</font></td>
<td bgcolor="#FFFFFF"> <font color="#0000FF"><%=rs("field1")%></font></td>
<td bgcolor="#FFFFFF"> <font color="#0000FF"><%=rs("field3")%></font></td>
<td align="center" bgcolor="#FFFFFF"><font color="#0000FF"><%=rs("field2")%></font></td>
<td align="center" bgcolor="#FFFFFF"><font color="#0000FF"><%=rs("field4")%></font></td>
<td align="center" bgcolor="#FFFFFF"><font color="#0000FF"> </font></td>
</tr>
<%
a=a+1
if a>=rs.PageSize then exit do
rs.movenext
if rs.eof then exit do
loop
%>
</table>
</td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" height="25"> 共<font color="#FF0000"><%=rs.recordcount%></font>条<font color="#FF0000"><%=total%></font>页
当前第<font color="#FF0000"><%=pageno%></font>页   </td>
<td align="right">【<a href=?ScrollAction=首页&PageNo=<%=PageNo%><%if request("action")<>"" then response.Write("&action=select")%><%if request("action")<>"" then response.Write("&name="&request("name"))%>>首页</a>】
【<a href=?ScrollAction=上一页&PageNo=<%=PageNo%><%if request("action")<>"" then response.Write("&action=select")%><%if request("action")<>"" then response.Write("&name="&request("name"))%>>上一页</a>】
【<a href=?ScrollAction=下一页&PageNo=<%=PageNo%><%if request("action")<>"" then response.Write("&action=select")%><%if request("action")<>"" then response.Write("&name="&request("name"))%>>下一页</a>】
【<a href=?ScrollAction=尾页&PageNo=<%=PageNo%><%if request("action")<>"" then response.Write("&action=select")%><%if request("action")<>"" then response.Write("&name="&request("name"))%>>尾页</a>】 </td>
</tr>
</table>
</center>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
ziying 2004-11-26
  • 打赏
  • 举报
回复
http://blog.csdn.net/ziying/archive/2004/11/16/aspbreakpage.aspx
good2speed 2004-11-26
  • 打赏
  • 举报
回复
'换页
set rs=server.CreateObject ("adodb.recordset")
rs.open sql,conn,3,1
rs.PageSize=30
allPage=rs.PageCount
rsCount=rs.RecordCount
if not IsNumeric(intPage) then intPage=1
if cint(intPage)>cint(allPage) then intPage=allPage
rs.AbsolutePage = intPage
i=1
for j=(intPage-1)*30+1 to (intPage-1)*30+30
if i/2=i\2 then
strColor=""'strColor="#A0E7DE"
else
strColor="bgcolor=""#FFFFFF"""
end if
%>

<%
rs.movenext
if rs.EOF then exit for
i=i+1
next
%>

<table width="100%">
<tr>
<td width="100%" align="center" >
<%if cint(intPage)>1 then%><a href="client_perform_edit.asp?intPage=1&B1=<%=B1%>&name=<%=name%>&proxy_id=<%=proxy_id%>&ByCorp=<%=ByCorp%>&ByDate=<%=ByDate%>&Contract_ID=<%=Contract_ID%>&Execute_State=<%=Execute_State%>&operator_en=<%=operator_en%>&BelongCorp=<%=BelongCorp%>&ByDate2=<%=ByDate2%>"><%end if%><img src="/mis/images/first.gif" border="0" alt="最前页" WIDTH="70" HEIGHT="22"></a>   
<%if cint(intPage)>1 then%><a href="client_perform_edit.asp?intPage=<%=intPage-1%>&B1=<%=B1%>&name=<%=name%>&proxy_id=<%=proxy_id%>&ByCorp=<%=ByCorp%>&ByDate=<%=ByDate%>&Contract_ID=<%=Contract_ID%>&Execute_State=<%=Execute_State%>&operator_en=<%=operator_en%>&BelongCorp=<%=BelongCorp%>&ByDate2=<%=ByDate2%>"><%end if%><img src="/mis/images/pre.gif" border="0" alt="上一页" WIDTH="70" HEIGHT="22"></a>   
<%if cint(intPage)<cint(allPage) then%><a href="client_perform_edit.asp?intPage=<%=intPage+1%>&B1=<%=B1%>&name=<%=name%>&proxy_id=<%=proxy_id%>&ByCorp=<%=ByCorp%>&ByDate=<%=ByDate%>&Contract_ID=<%=Contract_ID%>&Execute_State=<%=Execute_State%>&operator_en=<%=operator_en%>&BelongCorp=<%=BelongCorp%>&ByDate2=<%=ByDate2%>"><%end if%><img src="/mis/images/next.gif" border="0" alt="下一页" WIDTH="70" HEIGHT="22"></a>   
<%if cint(intPage)<cint(allPage) then%><a href="client_perform_edit.asp?intPage=<%=allpage%>&B1=<%=B1%>&name=<%=name%>&proxy_id=<%=proxy_id%>&ByCorp=<%=ByCorp%>&ByDate=<%=ByDate%>&Contract_ID=<%=Contract_ID%>&Execute_State=<%=Execute_State%>&operator_en=<%=operator_en%>&BelongCorp=<%=BelongCorp%>&ByDate2=<%=ByDate2%>"><%end if%><img src="/mis/images/last.gif" border="0" alt="最后页" WIDTH="70" HEIGHT="22"></a>   
</td>
</tr>
<tr>
<td width="100%" align="center" >
<form method="POST" action="client_perform_edit.asp" ><!--onsubmit="javascript:return checkform3()"-->共<%=rsCount%>条记录  第<%=intPage%>页/共<%=allPage%>页     转到
<input type="text" name="intPage" size=3>页
<input type="hidden" name="B1" value="<%=B1%>">
<input type="hidden" name="name" size=3 value="<%=name%>">
<input type="hidden" name="proxy_id" value="<%=proxy_id%>">
<input type="hidden" name="ByCorp" value="<%=ByCorp%>">
<input type="hidden" name="ByDate" value="<%=ByDate%>">
<input type="hidden" name="Contract_ID" value="<%=Contract_ID%>" >
<input type="hidden" name="Execute_State" value="<%=Execute_State%>" >
<input type="hidden" name="operator_en" value="<%=operator_en%>" >
<input type="hidden" name="BelongCorp" value="<%=BelongCorp%>" >
<input type="hidden" name="ByDate2" value="<%=ByDate2%>" >
</form>
</td>
</tr>
</table>


luluso 2004-11-26
  • 打赏
  • 举报
回复
捧场。。+ u p
91jk 2004-11-26
  • 打赏
  • 举报
回复
if str="" then
rs.PageSize=50
pages=rs.pagecount
records=rs.recordcount
currentpage=request("currentpage")
if currentpage="" or currentpage<1 then currentpage=1
currentpage=cint(currentpage)
if currentpage>pages then currentpage=pages
rs.absolutepage=currentpage
else
currentpage=1
records=0
pages=1
end if
'------------------------------------------------------
<%linenumber=rs.pagesize%>
<%do while (not rs.eof) and (line<linenumber)%>
'--------------------------------------------------------------------------------
<table width="100%" align="center" bgcolor="white">
<tr>
<td height="56" bgcolor="white"> <br>
您现在所在第<font color="blue"><%=currentpage%></font>页 供应信息共有<font color="blue">
<%=Records%> </font>条 <font size="2">每页显示</font><font color="blue">50</font>条
<%if currentpage>1 then%>
<font size="2"><a href="hxk.asp?currentpage=<%=currentpage-1%>&t1=<%=keyword%>&px=<%=px%>"><font size="2">[上一页]</font></a>
<%end if%>
<%if currentpage<pages then%>
<a href="hxk.asp?currentpage=<%=currentpage+1%>&t1=<%=keyword%>&px=<%=px%>">[下一页]</a>
<%end if%>
<%if currentpage>1 then%>
<a href="hxk.asp?currentpage=1&t1=<%=keyword%>&px=<%=px%>">[最首页]</a>
<%end if%>
<%if currentpage<pages then%>
<a href="hxk.asp?currentpage=<%=pages%>&t1=<%=keyword%>&px=<%=px%>">[最末页]</a>
<%end if%>
共有<font color="blue"><%=Pages%></font>页转到页码:[
<%for p=1 to pages%>
<a <%if currentpage=p then%> style="color:red" <%end if%> href="hxk.asp?currentpage=<%=p%>&t1=<%=keyword%>&px=<%=px%>"><%=p%></a>
<%if p/30=0 then%>
<%end if%>
<%next%>
]</font> </td>
</tr>
</table>
fffddd 2004-11-26
  • 打赏
  • 举报
回复
有多惊人?
香椿炒鸡蛋 2004-11-26
  • 打赏
  • 举报
回复
贴了这么多啊 我有一个改写的用存储过程分页的 效率高的惊人 呵呵
bozy 2004-11-26
  • 打赏
  • 举报
回复
分頁函數
http://www.thinksee.com/pagelist
lingyun2111 2004-11-26
  • 打赏
  • 举报
回复
来晚了,楼上已经贴了几个,我就不再贴了哟

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧