Create an ASP Common paging Class (ii) Code section

Source: Internet
Author: User
<%
'=====================================================================
' Xdownpage ASP version
' Version 1.00
' Code by zykj2000
' Email:zykj_2000@163.net
' Bbs:http://bbs.513soft.net
' This program can be free to use, modify, I hope my program can bring convenience to your work
' But please keep the above interest
'
' Program features
' This program is mainly to the data pagination part of the encapsulation, and the data display part completely by the user customization,
' Support URL multiple parameters
'
' Use instructions
' Program parameter description
' Papgesize defines the number of records per page of pagination
' Getrs Returns a paging recordset this property is read-only
' Getconn get a database connection
' GetSQL get the query statement
' Procedure Method description
' ShowPage display the pager bar, the only common method
'
Cases
' <!--#include file= ' conn.asp '-->
' <!--#include file= ' xdownpage.inc '--> ' contains files
'
' Set mypage=new xdownpage ' Create object
' Mypage.getconn=conn ' Get database connection
' mypage.getsql= ' select * from ProductInfo ORDER by ID ASC
' Mypage.pagesize=5 ' Sets the record bar data for each page to 5
' Set Rs=mypage.getrs () ' returns to the recordset
' Mypage.showpage () ' Displays paging information, which can be used after set Rs=mypage.getrs ()
' Call anywhere, you can call multiple times
' For I=1 to Mypage.pagesize ' The next action is the same as manipulating a normal Recordset object
' If not rs.eof then ' this tag is to prevent last page overflow
' Response.Write Rs (0) & "<br>" ' Here's how you can customize the display.
' Rs.movenext
' Else
' Exit for
' End If
' Next
'
'=====================================================================
Const btn_first= "<font face=webdings>9</font>" defines the first page button display style
Const btn_prev= "<font face=webdings>3</font>" defines the previous-page button display style
Const btn_next= "<font face=webdings>4</font>" defines the next-page button display style
Const btn_last= "<font face=webdings>:</font>" defines the last-page button display style
Related Article

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.