정적 페이지를 생성하고 ASP 애플릿 스크립트를 얻는 ASP 페이징 목록입니다.
코드 사본은 다음과 같습니다.
<!-#includefile = "conn.asp"->
<html> <head> <title> Pagination Test </title> <linkhref = "inc/style.css"type = text/cssrel = 스타일 시트> </head>
<%strhead = strhead & "<html>"
stread = stread & "<head>"
stread = stread & "<title> Pagination Test </title>"
strhead = strhead & "<linkhref =" "inc/style.css" "type = text/cssrel = 스타일 시트>"
stread = stread & "</head>"
%>
<%
SQL = "선택*FromNews"
setrs = server.createobject ( "adodb.recordset")
Rs.Opensql, Conn, 1,1
%> <%
Rs.Pagesize = 2
TotalPage = Rs.PageCount
Rs.Close
setrs = 아무것도
forj = 1TototalPage
SQL = "선택*FromNews"
setrs = server.createobject ( "adodb.recordset")
Rs.Opensql, Conn, 1,1
WhetPage = j
Rs.Pagesize = 2
TotalPage = Rs.PageCount
rs.AbsolutePage = Whatpage
Howmanyrecs = 0
%> <%
str0 = ""
str0 = str0 & "</p>"
str0 = str0 & "<tablebgcolor =#cecfcealign = centerborder = 0width = 800cellpadding = 2cellpacing = 1>"
%> <%
dowhilenotrs.eofandhowmanyrecs <rs.pagesize
%> <%
str0 = str0 & "<trbgcolor =#f7f7f7>"
str0 = str0 & "<tdbgcolor =#f7f7f7align =" "center" ">"& rs (0) & "</td>"
str0 = str0 & "<tdbgcolor =#f7f7f7align =" "center" ">"& rs (1) & "</td>"
str0 = str0 & "<tdbgcolor =#f7f7f7align =" "center" ">"& rs (2) & "</td>"
str0 = str0 & "<tdbgcolor =#f7f7f7align =" "center" ">"& rs (3) & "</td>"
str0 = str0 & "</tr>"
%> <%
rs.movenext
Howmanyrecs = Howmanyrecs+1
고리
Rs.Close
setrs = 아무것도
%> <%str0 = str0 & "</table>"
%> <%
'페이지 매김 섹션
ref = "" "
ref = ref & "<br>"
ref = ref & "<tablebgcolor =#cecfcealign = centerborder = 0width = 800cellpadding = 0cellspacing = 1>"
ref = ref & "<trbgcolor =#f7f7f7>"
ref = ref & "<td>"
ref = ref & "<b> 페이지 :"& j & "/"& totalpage & "</b>"
ref = ref & "</td>"
ref = ref & "<td>"
ref = ref & "<ahref = list_1.html"& ">"& "<fontface = webdings> 9 </font>"& "</a>" ""
if whatpage = 1then
ref = ref & "<fontface = webdings> 7 </font>"