다음은 일반적으로 사용되는 Pagination 기능에 대한 자세한 자습서입니다. 이 방법은 매우 간단합니다. 관심있는 친구, 편집자와 함께 배우자!
코드 사본은 다음과 같습니다.
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, "infotyp.asp? id ="& request ( "id")
또 다른
if (currentpage-1)*maxperpage
Rs.Move (CurrentPage-1)*MAXPERPAGE
Dimbookmark
북마크 = Rs.BookMark
showpage1totalput, maxperpage, "infotype.asp? id ="& request ( "id")
쇼 콘텐츠
showpagetotalput, maxperpage, "infotyp.asp? id ="& request ( "id")
또 다른
CurrentPage = 1
showpage1totalput, maxperpage, "infotype.asp? id ="& request ( "id")
쇼 콘텐츠
showpagetotalput, maxperpage, "infotyp.asp? id ="& request ( "id")
endif
endif
endif
%>
SubshowContent ()
%>
ID
선택하다
정보 제목
업데이트 날짜
딸깍 하는 소리
사람들을 추가하십시오
편집하다
삭제
[0] 생성
i = 1
dowhilenotrs.eof
%>
">
"대상 ="_ blank "> []
strcounts = truelen (thetitle1)
응답 .writetHetitle1
%>
dateTime = rs ( "dateTime")
yname = 년 (dateTime)
mname = month (dateTime)
iflen (mname)
dname = month (dateTime)
iflen (dname)
FolderName = yname & mname
%>
/.htm"title="view 생성 된 정적 페이지 "target ="_ blank ">
"> 수정
) "> 삭제
) "> 생성 ( ',' ','너비 = 0, 높이 = 0 ')">)
i = i+1
ifi> maxperpagetheneexitdo
rs.movenext
고리
%>
ID
선택하다
정보 제목
업데이트 날짜
딸깍 하는 소리
사람들을 추가하십시오
편집하다
삭제
생성하다
Endsub
%>
FunctionShowPage (TotalNumber, MaxperPage, Filename)
%>
Dimn
iftotalNumberModMaxPerPage = 0then
n = TotalNumber/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
응답. "["& ""& dxy & ""& "]" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""광 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""광" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" "" "" "" "" ""광" "" """y "" "" "" "((낸 () = 빨간>
또 다른
응답. "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" """형도도기 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""광" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" """광 "" "" "" "" "" "" "" "" "" ""광" "" """y "" "" "" "((낸 ()
endif
다음
%>
최종 기능 장애
%>
Rs.Close
setrs = 아무것도
conn.close
setconn = 아무것도 없습니다
%>
위의 것은 ASP Pagination 기능에 대한 자세한 자습서입니다. 나는 당신이 그것에 대해 배웠다고 믿습니다. 더 많은 관련 컨텐츠는 Wonew 기술 채널에 계속주의를 기울이십시오.