一般的に使用されるページネーション関数に関する詳細なチュートリアルを以下に示します。この方法は非常に簡単です。興味のある友達、編集者と一緒にそれについて学びましょう!
コードコピーは次のとおりです。
rs.opensql、conn、1,1
ifrs.eofandrs.bofthen
Response.Write "
「
それ以外
Totalput = rs.RecordCount
MapperPage = 18
ifcurrentPage
currentPage = 1
endif
if(currentPage-1)*maxperpage> totalputthen
if(totalputmodmaxperpage)= 0then
currentPage = Totalput/maxperpage
それ以外
currentPage = Totalput/maxperpage+1
endif
endif
ifcurrentPage = 1then
showpage1totalput、maxperpage、 "infotype.asp?id ="&request( "id")
showcontent()
showpageTotalput、maxperpage、 "infotype.asp?id ="&request( "id")
それ以外
if(currentPage-1)*maxperpage
rs.move(currentPage-1)*maxperpage
Dimbookmark
bookmark = rs.bookmark
showpage1totalput、maxperpage、 "infotype.asp?id ="&request( "id")
showcontent
showpageTotalput、maxperpage、 "infotype.asp?id ="&request( "id")
それ以外
currentPage = 1
showpage1totalput、maxperpage、 "infotype.asp?id ="&request( "id")
showcontent
showpageTotalput、maxperpage、 "infotype.asp?id ="&request( "id")
endif
endif
endif
%>
subshowcontent()
%>
id
選ぶ
情報タイトル
更新日
クリック
人を追加します
編集
消去
[ゼロ]を生成する
i = 1
dowhileenotrs.eof
%>
「>
"ターゲット=" _ blank "> []
strcounts = truelen(thetitle1)
Response.WritEthetitle1
%>
DateTime = rs( "DateTime")
yname = year(datetime)
mname = month(datetime)
iflen(mname)
dname = month(datetime)
iflen(dname)
foldername = yname&mname
%>
/.htm"title="view生成静的ページ "ターゲット=" _ blank ">
">変更します
) ">削除
) "> generate( '、' '、' width = 0、height = 0 ')">)
i = i+1
ifi> maxperpagetheneexitdo
rs.movenext
ループ
%>
id
選ぶ
情報タイトル
更新日
クリック
人を追加します
編集
消去
生成する
Endingub
%>
functionshowpage(totalnumber、maxperpage、filename)
%>
薄暗い
IftotalNumberModmaxperpage = 0then
n =合計number/maxperpage
それ以外
n = TotalNumber/maxperpage+1
endif
%>
合計 /アイテムがあります、
現在のページ/
[ホーム] [前のページ]
"> [home]&page ="> [前のページ]
[次のページ] [最後のページ]&page = "> [次のページ]&page ="> [最後のページ]
移動:
onchange = "location.href = this.options [this.selectedIndex] .Value">
ifcurrentPage = jthen
%>&page = "selected>
それ以外
%>
&page = ">
endif
次
%>
エンド機能
%>
functionshowpage1(totalnumber、maxperpage、filename)
%>
DIMB
IftotalNumberModmaxperpage = 0then
B = TotalNumber/MaxperPage
それ以外
B = TotalNumber/MaxperPage+1
endif
%>
合計 /アイテムがあります、
現在のページ/
dxystart = currentPage-5
ifdxystart
dxyend = currentPage+5
ifdxyend> bthendxyend = b
fordxy = dxystarttodxyend
ifdxy = currentPagethen
response.write"["&""&dxy&""&"]"&""""""""""""""""""""""""""""""""""""" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "」 =赤>
それ以外
response.write"["&dxy&""&"]"&"""""""""""""""""""""""""""""""""""""""" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "」
endif
次
%>
エンド機能
%>
rs.close
setrs =何もない
conn.close
setConn =何もない
%>
上記は、ASPページネーション関数に関する詳細なチュートリアルです。あなたはそれについて学んだと思います。より関連するコンテンツについては、引き続きWonew Technologyチャネルに注意を払います。