<%''++++++++++++++++++++++++++++++++++++++++++++ ++++
「呼び出し例」
'Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
'int_RPP=2 'ページごとに表示する数を設定します
'int_showNumberLink_=8 'ナンバーナビゲーション表示番号
'showMorePageGo_Type_ = 1 'ドロップダウン メニューですか、それとも入力値のジャンプですか? 複数回呼び出した場合、選択できるのは 1 つだけです
'str_nonLinkColor_="#999999" '非ホットリンクの色
'toF_="<font face=webdings>9</font>" 'ホームページ
'toP10_=" <font face=webdings>7</font>" 'トップ 10
'toP1_=" <font face=webdings>3</font>" '前へ
'toN1_=" <font face=webdings>4</font>" '次へ
'toN10_=" <font face=webdings>8</font>" '次の 10
'toL_="<font face=webdings>:</font>" '最後のページ
'============================== ==============
'このコードは VClass_Rs.Open と for ループの間にある必要があります
' VClass_Rs = CreateObject(G_FS_RS) を設定します
' VClass_Rs.Open This_Fun_Sql,User_Conn,1,1
' VClass_Rs.eof ではない場合 THEN
' VClass_Rs.PageSize=int_RPP
' cPageNo=NoSqlHack(Request.QueryString("ページ"))
' cPageNo="" の場合、cPageNo = 1
' isnumeric(cPageNo) でない場合は、cPageNo = 1
'cPageNo = Clng(cPageNo)
' cPageNo<=0 の場合、cPageNo=1
' cPageNo>VClass_Rs.PageCount の場合、cPageNo=VClass_Rs.PageCount
' VClass_Rs.AbsolutePage=cPageNo
' FOR int_Start=1 TO int_RPP
''++++++++++
'データを表示するためのループ本体を追加します
''++++++++++
'VClass_Rs.MoveNext
' VClass_Rs.eof または VClass_Rs.bof の場合は終了します
' 次
'END IF
'===========================================
'response.Write "<p>"& fPageCount(VClass_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)
''++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++
'************************************************ * *********
'目的: ページングのページパラメータを保持します
'送信クエリの一貫性
'入力: moveParam: ページングパラメータ
'removeList: 削除するパラメータ
'戻り値: ページング URL
'************************************************ * *********
関数 PageUrl(moveParam,removeList)
dim strName
dim KeepUrl、KeepForm、KeepMove
RemoveList=removeList&","&moveParam
KeepForm=""
Request.Form の各 strName について
'フォームパラメータの送信値とnull値を決定する
InstrRev(","&removeList&",",","&strName&",", -1, 1)>0 かつ Request.Form(strName)<>"" でない場合は、
KeepForm=KeepForm&"&"&strName&"="&Server.URLencode(Request.Form(strName))
終了する場合
RemoveList=removeList&","&strName
次
KeepUrl=""
Request.QueryString の各 strName について
そうでない場合 (InstrRev(","&removeList&",",","&strName&",", -1, 1)>0) 次に
KeepUrl = KeepUrl & "&" & strName & "= & Server.URLencode(Request.QueryString(strName))
終了の場合
次
KeepMove=KeepForm&KeepUrl
If (KeepMove <> "") then
KeepMove = 右(KeepMove, Len(KeepMove) - 1)
KeepMove = Server.HTMLEncode(KeepMove) & "&"
終了の場合
'PageUrl = replace(Request.ServerVariables("URL"),"/Search.asp","/Search.html") & "?" & KeepMove & moveParam & "=
PageUrl = "?" & KeepMove & moveParam & "=
終了機能
Function fPageCount(Page_Rs,showNumberLink_,nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,Page)
Dim This_Func_Get_Html_,toPage_,p_,sp2_,I,tpagecount
Dim NaviLength,StartPage,EndPage
This_Func_Get_Html_ = "" : I = 1
NaviLength=showNumberLink_
if IsEmpty(showMorePageGo_Type_) then showMorePageGo_Type_ = 1
tpagecount=Page_Rs.pagecount
If tPageCount<1 then tPageCount=1
if not Page_Rs.eof or Page_Rs.bof then
toPage_ = PageUrl("Page","submit,GetType,no-cache,_")
if Page=1 then
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""Home"">"&toF_&"</font> " &vbNewLine
それ以外
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&"1 title=""ホームページ"">"&toF_&"</a> " &vbNewLine
終了の場合
ページ<NaviLength の場合
開始ページ=1
それ以外
StartPage = fix(Page / NaviLength) * NaviLength
終了する場合
EndPage=StartPage+NaviLength-1
EndPage>tPageCount の場合 EndPage=tPageCount
StartPage>1 の場合
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_& Page - NaviLength &" title=""上"&int_showNumberLink_&"Page"">"&toP10_&"</a> " &vbNewLine
それ以外
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""上"&int_showNumberLink_&"page"">"&toP10_&"</font> " &vbNewLine
ページ <> 1 かつページ <>0 の場合
終了
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&(Page-1)&" title=""Previous Page"">"&toP1_&"</a> " &vbNewLine
それ以外
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""前のページ"">"&toP1_&"</font> " &vbNewLine
End If
For I=StartPage To EndPage
I=ページの場合
This_Func_Get_Html_=This_Func_Get_Html_& "<b>"&I&"</b>" &vbNewLine
それ以外
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&I&">" &I& "</a>" &vbNewLine
終了の場合
I<>tPageCount の場合、This_Func_Get_Html_=This_Func_Get_Html_& vbNewLine
次へ
ページ <> Page_Rs.PageCount およびページ <>0 の場合
This_Func_Get_Html_=This_Func_Get_Html_& " <a href="&toPage_&(Page+1)&" title=""次のページ"">"&toN1_&"</a> " &vbNewLine
それ以外
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""次のページ"">"&toN1_&"</font> " &vbNewLine
End
If EndPage<tpagecount then
This_Func_Get_Html_=This_Func_Get_Html_& " <a href="&toPage_& Page + NaviLength &" title=""下"&int_showNumberLink_&"Page"">"&toN10_&"</a> " &vbNewLine
それ以外
This_Func_Get_Html_=This_Func_Get_Html_& " <font color="&nonLinkColor_&" title=""下"&int_showNumberLink_&"page"">"&toN10_&"</font> " &vbNewLine
End If
Page_Rs.PageCount<>Page then
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&Page_Rs.PageCount&" title=""最後のページ"">"&toL_&"</a>" &vbNewLine
それ以外
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""最後のページ"">"&toL_&"</font>" &vbNewLine
End If
showMorePageGo_Type_ = 1 の場合、 then
薄暗い Show_Page_i
Show_Page_i = ページ + 1
Show_Page_i > tPageCount の場合、Show_Page_i = 1
This_Func_Get_Html_=This_Func_Get_Html_& "<input type=""text"" size=""4"" maxlength=""10"" name=""Func_Input_Page"" onmouseover=""this.focus();"" onfocus="" this.value='"&Show_Page_i&"';"" onKeyUp=""value=value.replace(/[^1-9]/g,'')"" onbeforepaste=""clipboardData.setData('text',clipboardData .getData('text').replace(/[^1-9]/g,''))"">" &vbNewLine _
&"<input type=""button"" value=""Go"" onmouseover=""Func_Input_Page.focus();"" onclick=""javascript:var Js_JumpValue;Js_JumpValue=document.all.Func_Input_Page.value;if (Js_JumpValue=='' || !isNaN(Js_JumpValue)) location='"&topage_&"'+Js_JumpValue; else location='"&topage_&"1';"">" &vbNewLine
Else
This_Func_Get_Html_=This_Func_Get_Html_& " Jump:<select NAME = menu1 onChange=""var Js_JumpValue;Js_JumpValue=this.options[this.selectedIndex].value;if(Js_JumpValue!='') location=Js_JumpValue;"">"
i=1 から tPageCount まで
This_Func_Get_Html_=This_Func_Get_Html_& "<オプション値="&toppage_&i
if Page=i then This_Func_Get_Html_=This_Func_Get_Html_& " selected style='color:#0000FF'"
This_Func_Get_Html_=This_Func_Get_Html_& ">ページ "&cstr(i)&"</option>" &vbNewLine
次
This_Func_Get_Html_=This_Func_Get_Html_& "</select>" &vbNewLine
End if
This_Func_Get_Html_=This_Func_Get_Html_& p_&sp2_&" <b>"&Page_Rs.PageSize&"</b> ページごとのレコードが次のようになります:<b><span class=""tx" "> "&sp2_&Page&"</span>/"&tPageCount&"</b> ページ、合計 <b><span id='recordcount'>"&sp2_&Page_Rs.recordCount&"</span></b> レコード。"
else
「記録が無い」
終了する場合
fPageCount = This_Func_Get_Html_
終了機能
%>
http://blog.csdn.net/hzf100/archive/2006/12/28/1465471.aspx