This is the asp applet script used to generate static pages in the asp page list.
Copy codeThe Code is as follows: <! -- # Include file = "conn. asp" -->
<Html> <% StrHead = strHead & "StrHead = strHead & "StrHead = strHead & "<TITLE> paging test </TITLE>"
StrHead = strHead & "<LINK href =" "inc/style.css" "type = text/css rel = stylesheet>"
StrHead = strHead & "%>
<%
SQL = "select * from news"
Set rs = server. createObject ("ADODB. Recordset ")
Rs. open SQL, conn, 1, 1
%> <%
Rs. pagesize = 2
Totalpage = rs. pagecount
Rs. close
Set rs = nothing
For j = 1 to totalpage
SQL = "select * from news"
Set rs = server. createObject ("ADODB. Recordset ")
Rs. open SQL, conn, 1, 1
Whichpage = j
Rs. pagesize = 2
Totalpage = rs. pagecount
Rs. absolutepage = whichpage
Howmanyrecs = 0
%> <%
Str0 = ""
Str0 = str0 & "</p>"
Str0 = str0 & "<table bgcolor = # cecfce align = center border = 0 width = 800 cellpadding = 2 cellspacing = 1>"
%> <%
Do while not rs. eof and howmanyrecs <rs. pagesize
%> <%
Str0 = str0 & "<tr bgcolor = # f7f7f7>"
Str0 = str0 & "<td bgcolor = # f7f7f7 align =" "center"> "& rs (0) &" </td>"
Str0 = str0 & "<td bgcolor = # f7f7f7 align =" "center"> "& rs (1) &" </td>"
Str0 = str0 & "<td bgcolor = # f7f7f7 align =" "center"> "& rs (2) &" </td>"
Str0 = str0 & "<td bgcolor = # f7f7f7 align =" "center"> "& rs (3) &" </td>"
Str0 = str0 & "</tr>"
%> <%
Rs. movenext
Howmanyrecs = howmanyrecs + 1
Loop
Rs. close
Set rs = nothing
%> <% Str0 = str0 & "</table>"
%> <%
'Paging part
Ref = ""
Ref = ref & "<br>"
Ref = ref & "<table bgcolor = # cecfce align = center border = 0 width = 800 cellpadding = 0 cellspacing = 1>"
Ref = ref & "<tr bgcolor = # f7f7f7>"
Ref = ref & "<td>"
Ref = ref & "<B> Pages:" & j & "/" & totalpage & "</B>"
Ref = ref & "</td>"
Ref = ref & "<td>"
Ref = ref & "<a href1_list_1.html" & ">" & "<FONT face = Webdings> 9 </FONT>" & "</a>"
If whichpage = 1 then
Ref = ref & "<FONT face = Webdings> 7 </FONT>"
Else
Ref = ref & "<a href = list _" & J-1 &". html "&"> "&" <FONT face = Webdings> 7 </FONT> "&" </a>"
End if
For counter = 1 to totalpage
Ref = ref & "<a href = list _" & counter & ". html" & "> [" & counter & "] </a>"
Ref = ref &""
If counter mod 10 = 0 then
Ref = ref & "<br>"
End if
Next
If (whichpage> totalpage or whichpage = totalpage) then
Ref = ref & "<FONT face = Webdings> 8 </FONT>"
Else
Ref = ref & "<a href = list _" & j + 1 &". html "&"> "&" <FONT face = Webdings> 8 </FONT> "&" </a>"
End if
Ref = ref & "<a href = list _" & totalpage &". html "&"> "&" <FONT face = Webdings>: </FONT> "&" </a>"
Dim fso, f
Dim strTitle, strContent, strOut
'Create a File System Object
Set fso = Server. createObject ("Scripting. FileSystemObject ")
Set f = fso. createTextFile (Server. MapPath ("list _" & j & ". html"), true)
'Write webpage content
F. WriteLine strHead & str0 & ref
F. close
Response. write "generating Page No." & j! <Br>"
%> <%
Next %>