Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
'Total_records total number of records
'Everypage_records: Number of Entries displayed per page
'Current_page current page number
'URL: the url to be passed. The variable to be passed can be contained here, for example, "list. asp? "Or" list. asp? Keyword = key &"
'The program call is relatively simple, but it is still more troublesome than PHP. Continue to work hard.
Sub show_page (total_records, everypage_records, current_page, url)
If IsNumeric (total_records) then
Total_records = Int (total_records)
Total_records = 0
If IsNumeric (everypage_records) then
Everypage_records = Int (everypage_records)
If everypage_records <= 0 then
Everypage_records = 10
Everypage_records = 10
If IsNumeric (current_page) then
Current_page = Int (current_page)
Current_page = 1
'The total number of pages, that is, the last page
If total_records mod everypage_records = 0 then
Last_page = Int (total_records/everypage_records)
Last_page = Int (total_records/everypage_records) + 1
'Determine whether current_page meets the criteria and attach the value to the page
If current_page> = last_page then
Page = last_page
Elseif current_page <= 1 then
Page = 1
Page = current_page
If page <= 0 then
Prepg = 0
Prepg = page-1
If page = last_page then
Nextpg = 0
Nextpg = page + 1
'Start record on this page
Firstcount = prepg * everypage_records
'End record of this page
If nextpg> = 1 then
Lastcount = (nextpg-1) * everypage_records
Lastcount = total_records
'Start pagination navigation bar code
Pagenav = ""
Pagenav1 = ""
Pagenav = pagenav & "display the total number of <B>" & firstcount & "-" & lastcount & "</B> records <B>" & total_records & "</B> records"
Pagenav1 = pagenav1 & "display the total number of <B>" & firstcount & "-" & lastcount & "</B> records <B>" & total_records & "</B> records"
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.