Instance reference: ASP paging generates HTML program
Source: Internet
Author: User
Reference | program | pagination | Generate HTML This is an ASP paging list generate a static page of ASP applet
<!--#include file= "conn.asp"-->
<%strHead=strHead& "strhead=strhead& "strhead=strhead& "<TITLE> pagination 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
ref=ref& "<a href=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 = 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)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service