那个jQuery插件实现分页,代码中是如何实现的
3个回答
展开全部
<%
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if BigClass<>"" and SmallClass <>"" then
sql="select * from news where BigClassName='"&BigClass&"' and SmallClassName='"&SmallClass&"' order by id desc"
rs.Open sql,conn,1,1
elseif BigClass<>"" then
sql="select * from news where BigClassName='"&BigClass&"' order by id desc"
rs.Open sql,conn,1,1
end if
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<div class="newslist">
<%
rs.PageSize=20
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<ul><li><span class="time"><%= RS("AddDate") %></span><a href="news_info.asp?id=<%= RS("id") %>" target="_blank"><%= RS("TITLE") %></a></li></ul>
<%
rs.movenext
if rs.eof then exit for
next
%>
</div>
<div class="clear"></div>
<div class="pagePanel pagePane2">
<ul><li class="cr"><form method=Post action="news.asp?BigClass=<%=BigClass%>&SmallClass=<%=SmallClass%>">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=1>首页</a> "
response.write "<a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=" & (page+1) & ">"
response.write "下一页</a> <a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&SmallClass="&SmallClass&"&page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</form></li></ul>
<div class="clear"></div>
</div><%
end if
rs.close
set rs=nothing
%>
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
if BigClass<>"" and SmallClass <>"" then
sql="select * from news where BigClassName='"&BigClass&"' and SmallClassName='"&SmallClass&"' order by id desc"
rs.Open sql,conn,1,1
elseif BigClass<>"" then
sql="select * from news where BigClassName='"&BigClass&"' order by id desc"
rs.Open sql,conn,1,1
end if
if rs.eof and rs.bof then
response.Write("暂时没有记录")
else
%>
<div class="newslist">
<%
rs.PageSize=20
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<ul><li><span class="time"><%= RS("AddDate") %></span><a href="news_info.asp?id=<%= RS("id") %>" target="_blank"><%= RS("TITLE") %></a></li></ul>
<%
rs.movenext
if rs.eof then exit for
next
%>
</div>
<div class="clear"></div>
<div class="pagePanel pagePane2">
<ul><li class="cr"><form method=Post action="news.asp?BigClass=<%=BigClass%>&SmallClass=<%=SmallClass%>">
<%if Page<2 then
response.write "首页 上一页 "
else
response.write "<a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=1>首页</a> "
response.write "<a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=" & Page-1 & ">上一页</a> "
end if
if rs.pagecount-page<1 then
response.write "下一页 尾页"
else
response.write "<a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page=" & (page+1) & ">"
response.write "下一页</a> <a href=NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&SmallClass="&SmallClass&"&page="&rs.pagecount&">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
response.write " 共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条记录 <b>"&rs.pagesize&"</b>条记录/页"
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='submit' value=' Goto ' name='cndok'></span></p>"
%>
</form></li></ul>
<div class="clear"></div>
</div><%
end if
rs.close
set rs=nothing
%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
有专门的插件,,不然自己写AJAX
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询