|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP脚本是采用明文(plaintext)方式来编写的。分页模块化分页
1.查询语句块
<%
获得以后文件名
temp=Split(request.ServerVariables("URL"),"/")
fy=temp(UBound(temp))
setrs=server.createobject("adodb.recordset")
ifnotisempty(request("page"))then
pagecount=cint(request("page"))
else
pagecount=1
endif
sql="select查询语句"
rs.opensql,conn,1,1
rs.pagesize=10分页纪录数
ifpagecount>rs.pagecountorpagecount<=0then
pagecount=1
endif
ifrs.eofandrs.bofthen%>
<divalign="center"class="001"><br>
对不起,没有切合搜刮前提的纪录!<br>
</div>
2.显现纪录块
<%
else
rs.AbsolutePage=pagecount
dowhilenotrs.eof%>
显现的纪录
<%i=i+2
rs.movenext
ifi>=rs.PageSizethenexitdo
loop
%>
3.
分页效果
<tablewidth="778"border="0"align="center"cellpadding="0"cellspacing="0">
<tralign="center">
<%ifrs.pagecount=1then%>
<tdheight="35"colspan="4"class=001><fontcolor="#000000">共有[<fontcolor="#ff0000"><%=rs.recordcount%></font>]条信息以后显现第<fontcolor="red">1~<%=rs.recordcount%></font>条</font></td>
</tr>
<tr>
<%else%>
<tdwidth="19%"height="35"align="center"valign="middle"class=001><fontcolor="#000000">
<%page_start=(pagecount-1)*rs.pagesize
ifpagecount=1thenpage_start=1
page_end=rs.pagesize*pagecount
ifpagecount*rs.pagesize=>rs.recordcountthenpage_end=rs.recordcountendif%>
共有[<fontcolor="#ff0000"><%=rs.recordcount%></font>]信息</font></td>
<tdwidth="58%"height="30"align="center"class="fy"><fontcolor="#000000">
<%
ifpagecount>5andpagecount<rs.PageCount-5andrs.pagecount>10then
qizu=pagecount-4
min=pagecount+5
response.write"<ahref="&source&"?page=1&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&"><fontcolor=0000BE>首页</font></a>"
response.write"<ahref="&source&"?page="+cstr(pagecount-1)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&"><fontcolor=0000BE>上一页</font></a>"
foripage=qizutomin
ifipagepagecountthen
response.write"<ahref="&source&"?page="+cstr(ipage)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&cityid="&cityid&"><fontcolor=0000BE>"+cstr(ipage)+"</font></a>"
else
response.write"<fontcolor=#FF0000>"&ipage&"</font>"
endif
next
response.write"<ahref="&source&"?page="+cstr(pagecount+1)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&"><fontcolor=0000BE>下一页</font></a>"
response.write"<ahref="&source&"?page="+cstr(rs.PageCount)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&"><fontcolor=0000BE>尾页<</p>Windows本身的所有问题都会一成不变的也累加到了它的身上。安全性、稳定性、跨平台性都会因为与NT的捆绑而显现出来; |
|