asp頁(yè)面內(nèi)容分頁(yè)顯示
<body>
<table border="0px" width="100%">
<tr>
<td width="5%" align="center">ID</td>
<td width="95%" align="center">內(nèi)容</td>
</tr>
<!-- #include file="conn1.asp" -->
<%
pagesize=10
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
sql1="select * from s order by id desc"
set cn1=server.CreateObject("ADODB.RecordSet")
cn1.open sql1,conn1,1,1
rs.move (currentPage-1)*rs.pagesize
i=1
while not cn1.eof
response.Write"<tr bgcolor='#E1E1E1'>"
response.Write "<td align='center'>"&cn1("id")&"</td>"
response.Write "<td>"&cn1("ccc")&"</td>"
response.Write"</tr>"
if i>=10 then exit while
i=i+1
cn1.movenext
wend
conn1.close
set conn1=nothing
%>
</table>
<p><a href="?page=1">首頁(yè)</a>
<%if currentPage>1 then%>
<a href="?page=<%=currentPage-1%>">前一頁(yè)</a>
<%end if%>
<%currentPage<rs.pagecount then%>
<a href="?page=<%=currentPage+1%>">后一頁(yè)</a>
<%end if%>
<a href="?page=<%=rs.pagecount%>">末頁(yè)</a>
<br />
</p>
</body>
</html>
上面的不行的話!找我給你做一個(gè)!
給我留言吧!
^^
直到你滿意為止!
這下好了
這是我一直自己用的分頁(yè)代碼,速度超快,上萬(wàn)條數(shù)據(jù)分頁(yè)都一樣流暢,代碼規(guī)范化.分享給你吧!你復(fù)制去就可以用了的.幫你套好了
<html>
<body>
<table border="0px" width="100%">
<tr>
<td width="5%" align="center">ID</td>
<td width="95%" align="center">內(nèi)容</td>
</tr>
<!-- #include file="conn1.asp" -->
<%
sql1="select * from s order by id desc"
set cn1=server.CreateObject("ADODB.RecordSet")
cn1.open sql1,conn1,1,1
page=request.querystring("page")
if page="" then
page=1
else
page=Cint(page)
end if
Section=request.querystring("section")
if Section="" then
Section=1
else
Section=Cint(Section)
end if
'變量賦值
intPageSize=10 '每頁(yè)顯示記錄數(shù)
intSectionSize=5 '多少頁(yè)為一段,像GOOGLE一樣
PrevSectionText="<FONT face=webdings>7</FONT>" '上一段的鏈接文字
NextSectionText="<FONT face=webdings>8</FONT>" '下一段的鏈接文字
PrevPageText="<FONT face=webdings>3</FONT>" '上頁(yè)的鏈接文字
NextPageText="<FONT face=webdings>4</FONT>" '下頁(yè)的鏈接文字
cn1.pagesize=intPageSize
intCount=cn1.RecordCount
intPageCount=cn1.pagecount
intSectionCount=(intPageCount - 1) \ intSectionSize + 1
if intCount>0 then
cn1.AbsolutePage=page
end if
for i=0 to intPageSize
if cn1.eof then exit For
response.Write"<tr bgcolor='#E1E1E1'>"
response.Write "<td align='center'>"&cn1("id")&"</td>"
response.Write "<td>"&cn1("ccc")&"</td>"
response.Write"</tr>"
cn1.movenext
next
'<!--分頁(yè)部分開(kāi)始-->
response.write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"
response.write "<tr><td align=""right""> 共有"&intCount&"記錄,"
response.write "分"&intPageCount&"頁(yè),當(dāng)前頁(yè)"&Page&",每頁(yè)顯示"&intPageSize&"條記錄"
'計(jì)算每一段的開(kāi)始頁(yè)
intStarPage=(Section-2) * intSectionSize + 1
'前一段
if Section<=1 then
response.Write(PrevSectionText & " ")
else
response.Write("<a href='?page=" & intStarPage & "& section=" & Section-1 & "'>" & PrevSectionText & "</a> ")
end if
'顯示頁(yè)碼列表
response.Write("第")
intStarPage=(Section-1) * intSectionSize + 1
for p=intStarPage to intStarPage + intSectionSize - 1
if p > intPageCount then exit for
if p=page then
response.Write("<strong>[" & p & "]</strong> ")
else
response.Write("<a href='?page=" & p & "& section=" & Section & "'>[" & p & "]</a> ")
end if
next
response.Write("頁(yè)")
'后一段
intStarPage=(Section) * intSectionSize + 1
if Section>=intSectionCount then
response.Write(" " & NextSectionText)
else
response.Write(" <a href='?page=" & intStarPage & "& section=" & Section+1 & "'>" & NextSectionText & "</a> ")
end if
response.write " </td>"
response.write "</tr>"
response.write "</table>"
'<!--分頁(yè)部分結(jié)束-->
conn1.close
set conn1=nothing
%>
</table>
</body>
</html>
陰陽(yáng)師年3月30日更新內(nèi)容一覽
*陰陽(yáng)師大人需要在新區(qū)集結(jié)期結(jié)束前,下載客戶端,在新區(qū)集結(jié)界面內(nèi)綁定對(duì)應(yīng)手機(jī)號(hào)進(jìn)行新區(qū)預(yù)約,同步小程序和H5頁(yè)面內(nèi)的預(yù)約信息,否則預(yù)約獎(jiǎng)勵(lì)會(huì)丟失,請(qǐng)陰陽(yáng)師大人留意。6.春分·清明消費(fèi)返利活動(dòng)開(kāi)啟!*活動(dòng)時(shí)間:3月30日維護(hù)后-4月12日23:59*活動(dòng)內(nèi)容:消耗魂玉、勾玉獲取積分并兌換各檔位獎(jiǎng)勵(lì)(最終檔為春季節(jié)氣頭像...
懇求DOS命令
二十四、mem \/c \/m \/p \/d 常規(guī)內(nèi)存顯示程序\/c顯示所有內(nèi)存駐留程序的占用情況,分為conventional常規(guī)內(nèi)存和uppermemory高端內(nèi)存占用,并顯示總的占用情況(常規(guī) 高端 保留 擴(kuò)展內(nèi)存)\/p分頁(yè)顯示,頁(yè)間暫停\/m后加模塊名 如:\/m msdos 顯示dos系統(tǒng)內(nèi)存的占用.\/d對(duì)常規(guī) 高端 保留 擴(kuò)展內(nèi)存加以詳細(xì)例表說(shuō)明通過(guò)分析,...
Oraclespool用法小結(jié)
spool常用的設(shè)置set colsep ; \/\/域輸出分隔符set echo off;\/\/顯示start啟動(dòng)的腳本中的每個(gè)sql命令 缺省為onset feedback off;\/\/回顯本次sql命令處理的記錄條數(shù) 缺省為onset heading off; \/\/輸出域標(biāo)題 缺省為onset pagesize ; \/\/輸出每頁(yè)行數(shù) 缺省為 為了避免分頁(yè) 可設(shè)定為 set termout off; ...
RPG Maker XP詳細(xì)用法
文章的顯示 在游戲畫(huà)面上顯示信息就要用到事件指令「顯示文章」。這是個(gè)常用的指令,在全部事件指令中使用得最多。數(shù)據(jù)庫(kù)數(shù)據(jù)庫(kù)的內(nèi)容編輯數(shù)據(jù)庫(kù)的內(nèi)容,在主菜單「工具」菜單中選擇「數(shù)據(jù)庫(kù)」。在對(duì)話框的分頁(yè)中進(jìn)行切換,就可以編輯下列各種不同種類的數(shù)據(jù)。角色 在游戲中被玩家操作的人物角色的數(shù)據(jù)。 職業(yè) 裝備的...
如何解決excel中插圖打印時(shí)位置移動(dòng)?
這是excel固有的毛病,不好解決。但可以給你一個(gè)變通的辦法:當(dāng)在excel中顯示正常的時(shí)候,用截圖工具(如:QQ、360瀏覽器)截取整個(gè)頁(yè)面,做為一個(gè)圖片。最后打印這個(gè)圖片即可。(當(dāng)然,如果用SP工具把圖片調(diào)整為最佳狀態(tài)再打印,效果更好)
Xshell用什么命令進(jìn)入
Xshell作為專業(yè)的終端模擬器,可以用來(lái)登錄Linux,從而通過(guò)命令來(lái)控制Linux系統(tǒng),下面就學(xué)習(xí)具體操作技巧。打開(kāi)電腦上的虛擬機(jī),啟動(dòng)Linux系統(tǒng),然后打開(kāi)Xshell軟件,連接上Linux系統(tǒng),如下圖所示。圖1:連接Linux 第一個(gè)命令:ls -l ls全稱是list,列出指定路徑下的所有文件,-l表示顯示文件的完整屬性。圖...
matlab三維圓柱
more 指令窗中內(nèi)容的分頁(yè)顯示 movie 放映影片動(dòng)畫(huà) moviein 影片幀畫(huà)面的內(nèi)存預(yù)置 mtaylor 符號(hào)計(jì)算多變量Taylor級(jí)數(shù)展開(kāi) N n ndims 求數(shù)組維數(shù) NaN 非數(shù)(預(yù)定義)變量 nargchk 輸入宗量數(shù)驗(yàn)證 nargin 函數(shù)輸入宗量數(shù) nargout 函數(shù)輸出宗量數(shù) ndgrid 產(chǎn)生高維格點(diǎn)矩陣 newplot 準(zhǔn)備新的缺省圖、軸 nextpow2 取最接近...
寵物小精靈世界之旅
顯示文字“\\”。 輸入文章時(shí)按「F2」鍵,就可預(yù)覽實(shí)際游戲中顯示的信息窗口。數(shù)據(jù)庫(kù) 數(shù)據(jù)庫(kù)的內(nèi)容 編輯數(shù)據(jù)項(xiàng)目 更改最大值 游戲中使用的各種數(shù)據(jù)集合在一起稱為數(shù)據(jù)庫(kù)。數(shù)據(jù)庫(kù)的內(nèi)容編輯數(shù)據(jù)庫(kù)的內(nèi)容,在主菜單「工具」菜單中選擇「數(shù)據(jù)庫(kù)」。在對(duì)話框的分頁(yè)中進(jìn)行切換,就可以編輯下列各種不同種類的數(shù)據(jù)。角色 ...
電腦win7c盤哪些文件可以刪除電腦c盤哪些文件可以刪除win7
1 小時(shí)前 · 致力于推動(dòng)文化傳播、內(nèi)容創(chuàng)作 藍(lán)韻文化傳媒 向TA提問(wèn) 關(guān)注 展開(kāi)全部 ⑴ win7系統(tǒng)c盤哪些文件可以刪除 由于微軟在Windows7中新加了很多的功能,使得WIN7系統(tǒng)盤(即C盤)空間從一安裝開(kāi)始,就很龐大,以下文件是可以刪除的:1、NVIDIA顯卡安裝程序刪除(可清理出2個(gè)G空間)路徑為:C:\\\\Program Files\\...
匯編寫(xiě)入顯存0b800的數(shù)據(jù)無(wú)法顯示
mov ax,4c00h int 21h;去掉試試看 還有去掉之后加上一個(gè)死循環(huán),如果是nasm編譯器的話加上jmp 這個(gè)不可能使分頁(yè)的問(wèn)題,你誰(shuí)用一個(gè)死循環(huán)會(huì)出錯(cuò),是不是打開(kāi)cmd后-然后打入這個(gè)程序路徑也無(wú)法顯示呢
相關(guān)評(píng)說(shuō):
碌曲縣機(jī)構(gòu): ______ 建立access的數(shù)據(jù)庫(kù)news,還有表news,表的字段(id,title),id唯一,輸入數(shù)據(jù)保存,用下面代碼可查詢,可分頁(yè) -----------------------下面保存為search.asp-------------------------- <html> <head> <meta http-equiv="Content-Type" content="text/html;...
碌曲縣機(jī)構(gòu): ______ 首先是recordset的創(chuàng)建 <% set rs=server.createobject("adodb.recordset") exce="sql" rs.open exce,conn,1,1 %> 然后是分頁(yè)屬性的設(shè)置 <% rs.PageSize=3 pagecount=rs.PageCount page=int(request("page")) if page<=0 then page=1 if ...
碌曲縣機(jī)構(gòu): ______ set rs ..(以上忽略) rs.pagesize = 4 '每頁(yè)顯示多少 page = int(request("page")) if page page = 1 elseif page > rs.recordcount then page = rs.recordcount end if rs.absolutepage = page for a = 1 to rs.pagesize(循環(huán)內(nèi)容) rs.movenext if rs.eof ...
碌曲縣機(jī)構(gòu): ______ 你把從表單里面提交上來(lái)的數(shù)據(jù)保存在變量里面,然后在搜索頁(yè)分頁(yè)時(shí)把們作為參數(shù)附著在URL后面就行了
碌曲縣機(jī)構(gòu): ______ ASP分頁(yè)函數(shù) Function ExportPageInfo(ByRef rs,curpage,i,LinkFile)Dim retval, j, pageNumber, BasePage retval = "第" & curpage & "頁(yè)/總" & rs.pagecount & "頁(yè) " retval = retval & "本頁(yè)" & i & "條/總" & rs.recordcount & "條 " If ...
碌曲縣機(jī)構(gòu): ______ <% set rs=server.createobject("adodb.recordset") sql="select * from 表名 order by id desc " rs.open sql,conn,1,1 %> 其實(shí)很簡(jiǎn)單的,首先你要連接數(shù)據(jù)庫(kù) <% rs.pagesize=8'這個(gè)是顯示最新的8條記錄,可以按自己需要改 curpage=Request....
碌曲縣機(jī)構(gòu): ______ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataBinder(); } } static int i = 0; //為了實(shí)現(xiàn)分頁(yè)那么需要手工綁定數(shù)據(jù); private void DataBinder() { PagedDataSource pds = new PagedDataSource(); pds.PageSize = 5;...
碌曲縣機(jī)構(gòu): ______ private PagedDataSource BindInfo(DataSet dsinfo) { //這里開(kāi)始寫(xiě)分頁(yè)代碼 PagedDataSource objpds = new PagedDataSource(); //填充數(shù)據(jù)信息 objpds.DataSource = dsinfo.DefaultViewManager; //是否在這里面起用分頁(yè) objpds....
碌曲縣機(jī)構(gòu): ______ if not isempty(request("page")) then pagecount=cint(request("page")) else pagecount=1 end if if not rs.eof and not rs.bof then rs.pagesize=20 rs.absolutepage=pagecount end if n=0 do while not rs.eof n=n+1 <% rs.movenext if n>=rs.pagesize then exit do loop %>
碌曲縣機(jī)構(gòu): ______ rs.PageSize=10 Page=CLng(request("Page")) if Page<1 then Page=1 if Page>rs.PageCount then Page=rs.PageCount rs.movefirst rs.absolutepage=Page 放在 rs.open sql,conn,1,1 do while not rs.eof 兩行中間<p> <% if page<>1 then ...