ASP page

xiaoxiao2021-03-05  22

'------------------------------------- --- 'Purpose: Implement pagination (RS already used for RecordSet object)' Enter: Numpage: Several page 'INTPAGE: Number of information: No' Back: No 'Output: No' Note: Use Display of records 'Usage: Call setPage (2, 10)' --------------------------------- ------------------- Sub setPage (Numpage, INTPAGE) 'LNGPAGENO is the number of information whose main program defined page variable' per page is displayed IF isNumeric (INTPAGE) AND LEN (INTPAGE)> 0 THEN RS.PAGESIZE = Clng (INTPAGE) Else rs.pageSize = 10 'default per page 10 END IF' Sequence Page Information If ISNUMERIC (NUMPAGE) AND LEN (Numpage)> 0 THEN IF CLNG numPage) <1 then rs.absolutepage = 1 lngPageNo = 1 elseif CLng (numPage)> rs.PageCount then rs.absolutepage = rs.PageCount lngPageNo = rs.PageCount else rs.absolutepage = CLng (numPage) lngPageNo = CLng (numPage) End if else = 1 lngpageno = 1 End IFEND SUB

'------------------------------------- --- 'Publishes: Paging information displayed, including other parameters of paging (RS already in the case of Recordset objects)' Enter: Numpage, StrParameters, StrParameters 'Return: No' Output: No 'Note: Display the page of records, and page connection' Usage: getpage '--------------------- ----------------------------- Sub getPageInfo (Numpage, strparameters) DIM = request.servervariables ("Path_INFO") 'If there are other parameters if len (strParameters)> 0 then strParameters = strParameters & "&" end if strParameters = "?" & strParameters strPageURl = strPageURl & strParameters' where the output record set response.write "total " & rs. RecordCount & " record," response.write "This is the" strong> "& number" "& rs.pagecount &" page.

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

New Post(0)