これは、静的ページを生成してASPアプレットスクリプトを取得するためのASPページングリストです
コードコピーは次のとおりです。
<! - #includefile = "conn.asp" - >
<html> <head> <title> pagination test </title> <linkhref = "inc/style.css" type = text/cssrel = styleSheet> </head>
<%strhead = strhead& "<html>"
strhead = strhead& "<head>"
strhead = strhead& "<title>ページネーションテスト</title>"
strhead = strhead& "<linkhref =" "inc/style.css" "type = text/cssrel = styleSheet>"
strhead = strhead& "</head>"
%>
<%
sql = "select*fromenews"
setrs = server.createObject( "adodb.recordset")
rs.opensql、conn、1,1
%> <%
rs.Pagesize = 2
TotalPage = rs.PageCount
rs.close
setrs =何もない
forj = 1tototalpage
sql = "select*fromenews"
setrs = server.createObject( "adodb.recordset")
rs.opensql、conn、1,1
whithpage = j
rs.Pagesize = 2
TotalPage = rs.PageCount
rs.absolutepage = whichpage
Howmanyrecs = 0
%> <%
str0 = ""
str0 = str0& "</p>"
str0 = str0& "<tablebgcolor =#cecfcealign = centerborder = 0width = 800cellpadding = 2cellpacing = 1>"
%> <%
dowhileenotrs.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>" "
whichpage = 1thenの場合
ref = ref& "<fontface = webdings> 7 </font>"