欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
ASP用于分頁(yè)的兩個(gè)函數
在asp代碼中分頁(yè)是有點(diǎn)麻煩的事情,個(gè)人在在代碼編寫(xiě)過(guò)程中把分頁(yè)代碼寫(xiě)成了兩個(gè)函數,雖然在功能上不是很完善,但對于一般的應用應該是滿(mǎn)足的了。

<%
‘分頁(yè)函數分為兩個(gè)函數
‘CalcPage(totalrec,msg_per_page,currentpage,n,rowcount,PageRs) 分頁(yè)計算函數
‘PageList(ListType,url,querry,Separator,ListLink) 分頁(yè)列表函數

‘分頁(yè)計算函數
‘totalrec 記錄集總數
‘msg_per_page 每頁(yè)顯示的記錄數,在調用CalcPage時(shí)需提前對該變量賦值
‘currentpage 當前頁(yè)變量,在調用CalcPage時(shí)需提前對該變量賦值
‘n 總頁(yè)數
‘rowcount 設置每一頁(yè)的數據記錄數
‘PageRs 記錄集對象
sub CalcPage(totalrec,msg_per_page,currentpage,n,rowcount,PageRs)
n=0 ‘設置無(wú)記錄時(shí)頁(yè)數為0
if currentpage="" then currentpage=0
‘PageRs.EOF and PageRs.bof 無(wú)記錄
‘Not PageRs.EOF Or Not PageRs.BOF 有記錄
if Not PageRs.EOF Or Not PageRs.BOF then
totalrec=PageRs.recordcount
PageRs.pagesize=msg_per_page
if totalrec mod msg_per_page = 0 then ‘計算總頁(yè)數,recordcount:數據的總記錄數
n = totalrec\msg_per_page ‘n:總頁(yè)數
else
n = totalrec\msg_per_page+1
end if
if not isnumeric(currentpage) or currentpage="" then currentpage=1
If currentpage <> "" then
currentpage = cint(currentpage)
end if
if currentpage < 1 then
currentpage = 1
end if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec) then
currentPage=1
end if
PageRs.absolutepage = currentpage ‘a(chǎn)bsolutepage:設置指針指向某頁(yè)開(kāi)頭
rowcount = PageRs.pagesize ‘pagesize:設置每一頁(yè)的數據記錄數
end if
end sub
%>
<%
‘分頁(yè)列表函數
‘url 跳轉的地址
‘querry ?后的參數
‘Separator 分隔符
‘ListType 分頁(yè)類(lèi)型
‘類(lèi)型:0 "第一頁(yè) | 前一頁(yè) | 下一頁(yè) | 最后頁(yè)"
‘類(lèi)型:1 "1 | 2 | 3 | 4 | ..........| 下一頁(yè)"
‘類(lèi)型:2 "第一頁(yè) | 前十頁(yè) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 后十頁(yè) | 最后頁(yè)"
‘ListLink 鏈接使用的樣式

sub PageList(ListType,url,querry,Separator,ListLink)
if Separator="" then Separator="|"
if ListType="" then ListType="0"
select case ListType
case "0"
response.write"第"&currentpage&"/"&n&"頁(yè)  "
response.write"共"&totalrec&"條信息  "
if currentpage <= 1 then
response.write"第一頁(yè) "&Separator&" "
response.write"前一頁(yè) "&Separator&" "
else
response.write"<a href="""&url&"?page=1&"&querry&""" class="""&ListLink&""">第一頁(yè)</a> "&Separator&" "
response.write"<a href="""&url&"?page="&currentpage-1&"&"&querry&""" class="""&ListLink&""">前一頁(yè)</a> "&Separator&" "
end if
if currentpage = n then
response.write"下一頁(yè) "&Separator&" "
response.write"最后頁(yè) "
else
response.write"<a href="""&url&"?page="&currentpage+1&"&"&querry&""" class="""&ListLink&""">下一頁(yè)</a> "&Separator&" "
response.write"<a href="""&url&"?page="&n&"&"&querry&""" class="""&ListLink&""">最后頁(yè)</a> "
end if
case "1"
if currentpage < n then
response.write"<a href="""&url&"?page="&currentpage+1&"&"&querry&""" class="""&ListLink&""">下一頁(yè)</a> "
else
response.write"下一頁(yè) "
end if
for i=1 to n
if cstr(i)=cstr(currentpage) then
response.write "<b>"&i&"</b>"&" "&Separator&" "
else
response.write"<a href="""&url&"?page="&i&"&"&querry&""" class="""&ListLink&""">"&i&"</a> "&Separator&" "
end if
next

case "2"
PageMerCout=10 ‘每次可翻的最大頁(yè)數
‘取得記錄的最大頁(yè)碼段
if n mod PageMerCout=0 then
MaxPageFiled=n\PageMerCout
else
MaxPageFiled=n\PageMerCout+1
end if
‘判斷當前頁(yè)所在的頁(yè)碼段
if currentpage mod PageMerCout =0 then
CurrPageFiled=currentpage\PageMerCout
else
CurrPageFiled=currentpage\PageMerCout+1
end if
‘取得當前頁(yè)碼段的最大頁(yè)碼和最小頁(yè)碼
MaxPageNo=CurrPageFiled*PageMerCout
MinPageNo=(CurrPageFiled-1)*PageMerCout+1
‘輸出 “第一頁(yè) | 前十頁(yè) |”
if currentpage<=1 then
response.write"第一頁(yè) "&Separator&" "
else
response.write"<a href="""&url&"?page=1&"&querry&""" class="""&ListLink&""">第一頁(yè)</a> "&Separator&" "
end if
if CurrPageFiled<=1 then
response.write"前十頁(yè) "&Separator&" "
else
response.write"<a href="""&url&"?page="&MinPageNo-PageMerCout&"&"&querry&""" class="""&ListLink&""">前十頁(yè)</a> "&Separator&" "
end if
‘輸出當前頁(yè)碼段
for i=MinPageNo to MaxPageNo
if i<=n then
if cstr(i)=cstr(currentpage) then
response.write "<b>"&i&"</b>"&" "&Separator&" "
else
response.write"<a href="""&url&"?page="&i&"&"&querry&""">"&i&"</a> "&Separator&" "
end if
end if
next
‘輸出 “后十頁(yè) | 最后頁(yè)”
if CurrPageFiled>=MaxPageFiled then
response.write"后十頁(yè) "&Separator&" "
else
response.write"<a href="""&url&"?page="&MaxPageNo+1&"&"&querry&""" class="""&ListLink&""">后十頁(yè)</a> "&Separator&" "
end if
if currentpage>=n then
response.write"最后頁(yè) "
else
response.write"<a href="""&url&"?page="&n&"&"&querry&""" class="""&ListLink&""">最后頁(yè)</a> "
end if
end select
end sub
%>

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
ASP分頁(yè)技術(shù)源碼
2個(gè)通用的ASP分頁(yè)方法
發(fā)送post請求渲染el-table,并實(shí)現搜索和分頁(yè)功能
Spring JPA 查詢(xún)的幾種方式并處理分頁(yè)
SQL Server中利用存儲過(guò)程來(lái)高性能地進(jìn)行分頁(yè)
分頁(yè)功能之PageBean
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久