<%''++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++
''호출 예
'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_="<fontface=webdings>9</font>" '홈페이지
'toP10_=" <fontface=webdings>7</font>" '상위 10위
'toP1_=" <fontface=webdings>3</font>" '이전
'toN1_=" <fontface=webdings>4</font>" '다음
'toN10_=" <fontface=webdings>8</font>" '다음 10개
'toL_="<fontface=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
' 숫자가 아니면(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인 경우 종료됩니다.
' 다음
'끝나는 경우
'============================================
'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)
희미한 문자열 이름
희미한 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 <> "") 그러면
KeepMove = 오른쪽(KeepMove, Len(KeepMove) - 1)
KeepMove = Server.HTMLEncode(KeepMove) & "&"
종료 조건
'PageUrl = replacement(Request.ServerVariables("URL"),"/Search.asp","/Search.html") & "?" & KeepMove & moveParam & "="
PageUrl = "?" & KeepMove & moveParam & "="
기능 종료
함수 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
Page_Rs.eof가 아니거나 Page_Rs.bof가 아닌 경우
tPageCount=1인
경우toPage_ = PageUrl("Page","submit,GetType,no-cache,_")
인 경우 Page=1인 경우
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=""Homepage"">"&toF_&"</a> " &vbNewLine
종료 조건
Page<NaviLength이면
시작페이지=1
또 다른
StartPage = 수정(페이지 / NaviLength) * NaviLength
종료하면
EndPage=시작페이지+NaviLength-1
EndPage>tPageCount인 경우 EndPage=tPageCount인
경우 StartPage>1인 경우
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_& 페이지 - 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
종료 If
페이지 <> 1 및 페이지 <>0 그러면
This_Func_Get_Html_=This_Func_Get_Html_& "<a href="&toPage_&(Page-1)&" title=""이전 페이지"">"&toP1_&"</a> " &vbNewLine
또 다른
This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""이전 페이지"">"&toP1_&"</font> " &vbNewLine
I=StartPage에서 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
종료 조건
내가 <>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
If EndPage<tpagecount Then
This_Func_Get_Html_=This_Func_Get_Html_& " <a href="&toPage_& 페이지 + 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
if Page_Rs.PageCount<>페이지 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
종료
If showMorePageGo_Type_ = 1이면
희미한 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=""이동"" 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_& " 점프:<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_& "<옵션 값="&topage_&i
Page=i이면 This_Func_Get_Html_=This_Func_Get_Html_& " 선택한 스타일='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