Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Just now, when I saw a netizen talking about paging, I think it was the simplest effect to create a paging function.
This section is used to open the table and assign values to the elements (saving you the need to connect to the database, please do it yourself ):
<% SQL = "........................ "
Rs. open SQL, conn, 1, 1
Rs. pagesize = 10'. This indicates that 10 records are displayed on each page.
Page = clng (request ("page") 'gets the page number value
If page = "" or page <1 then page = 1'
If page> rs. pagecount then page = rs. pagecount
Rs. AbsolutePage = page %>
Next, place the following code in the desired position to display the page turning link:
<% If page <> 1 then %> <a href = "page. asp? Page = 1 "> homepage </a> <% else %> homepage <% end if %> |
<% If page> 1 then %> <a href = "page. asp? Page = <% = page-1%> "> Previous page </a> <% else %> Previous page <% end if %> |
<% If page <rs. pagecount then %> <a href = "page. asp? Page = <% = page + 1%> "> Next page </a> <% else %> Next page <% end if %> |
<% If page <> rs. pagecount then %> <a href = "page. asp? Page = <% = rs. pagecount %> "> Last page </a> <% else %> last page <% end if %> |
Total <% = rs. pagecount %> pages/page <% = page %>/<% = rs. recordcount %> records
Then, the statement for paging is not used:
While not rs. eof
Replace with the following code:
For ipage = 1 to rs. pagesize
If rs. eof then exit for 'The Last Record jumps out of the loop
Okay, that's easy enough .. When I first started playing this game, it was a huge piece of code that made my head dizzy .. I hope it will help you.
I posted "original" here for the first time, but I don't know if I am qualified to go to the "Document Center .. Haha ..
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.