jquery分页的问题
像这个图片样式的,怎么在ASP中应用?比如我原来的分页程序是这样的:<%page=clng(request("page"))Setrs=Server.CreateObje...
像这个图片样式的,怎么在ASP中应用?比如我原来的分页程序是这样的:
<%
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
%> 展开
2个回答
展开全部
<%
function pager(thisPage,totalPage,url,groupSize)
dim startNum,endNum
thisPage = cint(thisPage)
totalPage = cint(totalPage)
step = int(groupSize/2)
if thisPage>totalPage then
thisPage = totalPage
end if
if thisPage<1 then
thisPage = 1
end if
if thisPage>=groupSize then
startNum=thisPage-step
endNum=thisPage+step
if startNum<1 then
startNum=1
endNum=startNum+groupSize
end if
if endNum>totalPage then
endNum=totalPage
startNum=endNum-groupSize
end if
else
startNum=1
if totalPage > groupSize then
endNum=groupSize
else
endNum=totalPage
end if
end if
response.Write("<div id=""letter""><ul>")
if thisPage > 1 then
response.Write("<li><a href="""& url &"1"">首页</a></li><li><a href="""& url & thisPage-1 &""">上一页</a></li>")
else
response.Write("<li>首页</li><li>上一页</li>")
end if
for i= startNum to endNum
if i = thisPage then
response.Write("<li><B>"&i&"</B></li>")
else
response.Write("<li><a href="""& url & i & """>"& i &"</a></li>")
end if
next
if thisPage < totalPage then
response.Write("<li><a href="""& url & thisPage+1 &""">下一页</a></li><li><a href="""& url & totalPage &""">尾页</a></li>")
else
response.Write("<li>下一页</li><li>尾页</li>")
end if
response.Write("</ul></div>")
end function
%>
<%
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
url = "NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page="
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>
<%
call pager(page,pages,url,10)
%>
<%
end if
rs.close
set rs=nothing
%>
<style>
/* pager */
#letter { padding:2px; }
#letter ul { clear:both; height:15px;}
#letter li { margin:0 4px 0 0; float:left; padding-left:5px; padding-right:5px; font-size:14px; border:1px solid #84B0C7; background:#E5EEF5; text-align:center; list-style-type: none;}
#letter li a { background:#E5EEF5; display:block; }
#letter li a:hover{ background:#FFF; text-decoration:none; }
</style>
function pager(thisPage,totalPage,url,groupSize)
dim startNum,endNum
thisPage = cint(thisPage)
totalPage = cint(totalPage)
step = int(groupSize/2)
if thisPage>totalPage then
thisPage = totalPage
end if
if thisPage<1 then
thisPage = 1
end if
if thisPage>=groupSize then
startNum=thisPage-step
endNum=thisPage+step
if startNum<1 then
startNum=1
endNum=startNum+groupSize
end if
if endNum>totalPage then
endNum=totalPage
startNum=endNum-groupSize
end if
else
startNum=1
if totalPage > groupSize then
endNum=groupSize
else
endNum=totalPage
end if
end if
response.Write("<div id=""letter""><ul>")
if thisPage > 1 then
response.Write("<li><a href="""& url &"1"">首页</a></li><li><a href="""& url & thisPage-1 &""">上一页</a></li>")
else
response.Write("<li>首页</li><li>上一页</li>")
end if
for i= startNum to endNum
if i = thisPage then
response.Write("<li><B>"&i&"</B></li>")
else
response.Write("<li><a href="""& url & i & """>"& i &"</a></li>")
end if
next
if thisPage < totalPage then
response.Write("<li><a href="""& url & thisPage+1 &""">下一页</a></li><li><a href="""& url & totalPage &""">尾页</a></li>")
else
response.Write("<li>下一页</li><li>尾页</li>")
end if
response.Write("</ul></div>")
end function
%>
<%
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
url = "NewsClass.asp?BigClass="&BigClass&"&SmallClass="&SmallClass&"&page="
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>
<%
call pager(page,pages,url,10)
%>
<%
end if
rs.close
set rs=nothing
%>
<style>
/* pager */
#letter { padding:2px; }
#letter ul { clear:both; height:15px;}
#letter li { margin:0 4px 0 0; float:left; padding-left:5px; padding-right:5px; font-size:14px; border:1px solid #84B0C7; background:#E5EEF5; text-align:center; list-style-type: none;}
#letter li a { background:#E5EEF5; display:block; }
#letter li a:hover{ background:#FFF; text-decoration:none; }
</style>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询