Pagination Display--> Rollover 10-page implementation

Source: Internet
Author: User
pagination | show <%
Set Con=server. CreateObject ("ADODB.") Connection ")
strconnection= "Data source=xxxxxxx;"
Con. Open strconnection

Set rs = Server.CreateObject ("ADODB.") Recordset ")
Chartsql= "Select Id,name,category_one from Goods"
Rs. Open chartsql,con,1,3
If Rs. EOF or Rs. BOF Then ' if empty
Response.End
End If
pagesize=10 ' Every page shows 10 records
Pagecuont=rs. PageCount ' Total pages
Recordcount=rs. RecordCount
Dim pagenum ' Current Page number
Dim CurrentRecord ' Number of records for current page, not equal to last value pagesize
If Request.QueryString ("pagenum") = "" Then
Pagenum=1
Else
Pagenum=request.querystring ("Pagenum")
Rs. AbsolutePage =trim (Request.QueryString ("Pagenum"))
End If
%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta name= "generator" content= "Microsoft FrontPage 4.0" >
<meta name= "ProgId" content= "FrontPage.Editor.Document" >
<title>new Page 1</title>
<script language=javascript>
<!--
function Openwindow (URL) {
window.open (URL, ', ' Resizable=no,width=240,height=160,fullscreen=yes ')
}
-->
</SCRIPT>
<link rel= "stylesheet" href= "File:///F|/mysourceof17560/CSS.CSS" type= "Text/css" >
<body bgcolor= #999999 >
<p align= "Center" > Product Modification Page </p>
<table border= "1" width= "100%" cellpadding= "0" cellspacing= "0" bordercolordark= "#999999" bordercolorlight= "# 000000 ">
<tr>
&LT;TD width= "10%" >
<div align= "center" > Number </div>
</td>
&LT;TD width= "63%" >
<div align= "center" > Product name </div>
</td>
&LT;TD width= "14%" >
<div align= "Center" > main category </div>
</td>
&LT;TD width= "13%" >
<div align= "center" > Operations </div>
</td>
</tr>
<%
For I=1 to Rs. PageSize
If Rs. EOF or Rs. BOF Then ' this condition to determine whether the end of
Exit For
End If
%>
<tr>
&LT;TD width= "10%" Align=center><%=rs ("ID")%></td>
&LT;TD width= "63%" Align=center><%=rs ("name")%> </td>
&LT;TD width= "14%" Align=center><%=rs ("Category_one")%> </td>
&LT;TD width= "13%" >
<div align= "center" >
<input type= "button" value= "button" Id=button1 name=button1
ID ")%>&zfenlei=<%=rs (" Category_one ")%> ', ', ' resizable=no,width=240,height=160 ') ' >
</div>
</td>
</tr>
<%
Number of records for the current page taken by currentrecord=currentrecord+1
Rs. MoveNext
Next
Rs. Close
%>
</table>
<div align= "center" class= "Bfont" > Total <%=recordCount%> Records | The
<%
Pagenum_record= (pageNum-1) *pagesize+1 ' initial record location
Pagenum_record_=pagenum_record+currentrecord-1 ' End record location
Response.Write Pagenum_record
%>
-<%=pagenum_record_%> Strip | Page <%=pageNum%> | Total <%=pagecuont%> page
<%
If Pagecuont >0 then ' prevents null records that are currently returned, that is, the dataset in the database is empty
If Pagenum > 1 then%>
<a href= "Modifychart.asp?pagenum=1" > <font color= "#FFFFFF" > Home </font></a>
<%
Else Response.Write "Home"
End If
If Pagenum > Then
' If necessary, add here the code for the top N page if it is less than 10 pages,
' Please refer to the following code and ideas for how to handle it if you have less than 10 pages later
%>
<a href= "modifychart.asp?pagenum=<%= (pageNum-10)%>" > <font color= "#FFFFFF" > First 10 page </font> </a>
<%
End If
if (pagenum+10) < Pagecuont Then
' Here's the same reference to the following ideas
%>
<a href= "modifychart.asp?pagenum=<%= (pagenum+10)%>" > <font color= "#FFFFFF" > next 10 page </font> </a>
<%
End If
if (pagenum+10) < Pagecuont Then
' Here to determine if there are 10 pages behind
Endpage=pagenum+9
Else
Endpage=pagecount
End If
For I=pagenum to EndPage
%>
<a href= "modifychart.asp?pagenum=<%=i%>" > <%=i%> page </a>
<%
Next
If Pagenum <> PageCount Then
%>
<a href= "modifychart.asp?pagenum=<%=pagecuont%>" > <font color= "#FFFFFF" > last page </font></a >
<%
End If
End If ' End of--->if pagecount >0 Then
%>
</div>
</body>

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.