นี่คือรายการ Paging ASP เพื่อสร้างหน้าคงที่และรับสคริปต์ Applet Applet
การคัดลอกรหัสมีดังนี้:
<!-#includefile = "conn.asp"->
<Html> <head> <title> การทดสอบการแบ่งแยก pagination </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*fromnews"
setRs = server.createObject ("adodb.recordset"))
Rs.opensql, Conn, 1,1
-
Rs.Pagesize = 2
TotalPage = Rs.pagecount
Rs.close
setrs = ไม่มีอะไร
forj = 1tototalpage
sql = "select*fromnews"
setRs = server.createObject ("adodb.recordset"))
Rs.opensql, Conn, 1,1
หน้าใด = j
Rs.Pagesize = 2
TotalPage = Rs.pagecount
Rs.absolutePage = ซึ่งหน้าใด
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>" "
ถ้าหน้าไหน = 1 จากนั้น
ref = ref & "<fontface = webdings> 7 </font>"