Object-oriented ASP programming VII--Paging object (VBScript edition)
Source: Internet
Author: User
<script Language=vbscript runat=server>
' ************************************************************************
' Script Compont Object Model
' Design for Active Server Pages
'
' Copyright Version 2.0
' Made by Ying Guang
' ************************************************************************
function Createcpagenavbar ()
Set Createcpagenavbar=new Cpagenavbar
End Function
Class Cpagenavbar
Public Splitsize ' Paging display capacity
Public Pnwidth
Public pnalign
Public plwidth ' table width
Public plalign ' table alignment
Private PageSize
Private RecordCount ' total record number]
Private PageCount ' total pages
Private CurrentPage ' current page number
The total number of pages displayed in private Splitcount ' pagination
Private currentsplit ' current pagination page numbering
'===============================================================
Private Sub class_initialize ' Setup Initialize event.
splitsize=10
Pnwidth= "100%"
Pnalign= "Right"
Plwidth= "100%"//Table width
Plalign= "right"//table alignment
Pagesize=0
Recordcount=0
Currentpage=1
Pagecount=1
Splitcount=1
Currentsplit=1
End Sub
Private Sub class_terminate ' Setup Terminate event.
End Sub
Public Sub Initpagenavbar (ByVal ipagesize,byval iRecordCount)
Pagesize=cint (Ipagesize)
RECORDCOUNT=CLNG (iRecordCount)
Pagecount=fix (recordcount/pagesize) +1
Splitcount=fix (pagecount/splitsize) +1
End Sub
Public Function Getcurrentpage ()
' On Error Resume Next
Dim PageNo
PageNo =trim (Request.QueryString ("_page_no_"))
' If the page is not selected, the first page is displayed by default;
if (not IsNumeric (PageNo)) or pageno= "") Then
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