Object-oriented ASP programming seven - Paging object (VBScript version)

xiaoxiao2021-03-06  212

<*******************************************************************************************************************************************************************************************************************************************************************************TION ******************************** The Script Compont Object Model 'Design for Active Server Pages' 'Copyright 2004 Version 2.0' Made by Yin Shuguang '**************************************************** *************************** function CreateCPageNavbar () set CreateCPageNavbar = new CPageNavbarend functionClass CPageNavbar public SplitSize 'capacity public PnWidth public PnAlign public paginated total number of pages of the current page displayed in the private paging CurrentSplit 'PlWidth' table width public PlAlign 'alignment of the table private PageSize private RecordCount' total records] private PageCount 'pages private CurrentPage' current page private SplitCount 'points Page size '================================================ =============== 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 subpublic function getCurrentPage () 'on error resume Next Dim Pageno Pageno = Trim ("_page_no_"))' If you do not choose the first few pages, the first is the first Page; if isnumeric (PAGENO)) or Pageno = "") THEN PAGENO = 1 end if currentpage = clng (PAGENO) IF (CurrentPage <1) THEN CURRENTPAGE = 1 End ififf (currentpage> PageCount) THEN CURRENTPAGE = PageCount end if currentsplit = fix (currentpage / splitsize) 1 getCurrentPage = CURRENTPAGE END FUNCTION

public function plDisplay () dim strBuilder, p, itmp strBuilder = "" 'first group of group 0 strBuilder = strBuilder "

"strBuilder = strBuilder " "strBuilder = strBuilder "
page: "if (CurrentSplit = 1) then strBuilder = strbuilder 9 "strbuilder = strbuilder " 7 "else strbuilder = STRBUILDER 9

"Strbuilder = strbuilder " 7 "end if strbuilder = strbuilder " "'page list ITMP = (currentsplit-1) * splitsize 1 for i = itmp to (itmp splitsize-1) if (i = currentpage ) THEN STRBUILDER = STRBUILDER " & cstr (i) &" "else strbuilder = strbuilder & CSTR (I) & " = pagecount) THEN EXIT for end if next strbuilder = strbuilder "" down Top 10 IF (currentsplit 8

Face = 'Webdings'>: "else strbuilder = strbuilder 8 " strbuilder = strbuilder : "end if strbuilder = strbuilder " "response.write (strbuilder) end function public function pndisplay () DIM STRBUILDER, nextPageNo strBuilder = "" strBuilder = strBuilder "

" strBuilder = strBuilder "" strbuilder = strbuilder Page: [ & CSTR (CURRENTPAGE) & " / " & cstr (pagecount) & "] page

Total number of records per page [ "&" ]: [ "& cstr (recordcount) &" ]: "strbuilder = strbuilder " < TD align = 'Right'> "IF (CINT (CURRENTPAGE)> 1) THEN NEXTPAGENO = CINT (CURRENTPAGE) -1 Strbuilder = Strbuilder " [

Title = 'Go to the previous page'> Previous ] "end if if if if if if if if if if if if if if if if if if if ififf (cintpage)

Title = 'Go to the next page'> Next ] "End if strbuilder = strbuilder " "Response.write (strbuilder) End Function End Class

转载请注明原文地址:https://www.9cbs.com/read-87356.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.049, SQL: 9