Paging with DWMX2004 plug-in package can implement various paging functions of ASP, but the code is a bit scary, we in the actual project development, there is no simpler way to achieve "once and for all"? The answer is yes.
The features we need:
1, call the module, only need to pass the recordset and the number of records displayed on each page;
2, you can click on the link to page, you can also directly enter the page number, return to the page;
3, do not consider the filename, the program every page can be in the current pages.
Specific writing content
You can turn the link into the page to make the picture button, so that the surface will be more beautiful.
Call Method:
1. Include the paging module file at the beginning of the program or where the page is to be used;
2, define variables: RowCount, the number of records displayed per page
3, call the page process: Callturnpage (recordset, ROWCOUNT)
4. Add "rowcount>0" condition to the condition of dowhile cyclic output recordset
5, at the end of the loop "loop before" plus: rowcount=rowcount-1
Use Example:
1.
2. We use DWMX2004 to create a new ASP page with the following contents
<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<!--#includefile = "connections/conn.asp"-->
<!--#includefile = "pagein.asp"--> ' introduction of public paging module
<% ' defines a recordset
Dimrsnews
Dimrsnews_numrows
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.