Module in the project

zhaozj2021-02-16  55

In large ASP projects, many pages involve flipping functionality. If each page writes a flip-page program, such a job reduces work efficiency and is not conducive to the modularization of the project, and does not cause the code to be reused. Therefore, it is necessary to modulate the function modularity of the page. Design method: 1. When calling the module, only the number of records and records of the record set and the records displayed per page; File names, each page page of the program can be on the current page. I want to clearly have three problems above, and our public flip module can do it.

<% ' ' ◆ Module Name: Public Tour Module ' ◆ File Name: TurnPage.asp '◆ Introduction Parameters: RS_TMP (Record Set) 'Sub Turnpage (Byref Rs_TMP, Pagesize)' rs_tmp record set PageSize's number of records displayed per page; DIM TotalPage 'pages Dim PageNo' currently displayed page is the first of several Dim RecordCount 'the total number of records Rs_tmp.PageSize = PageSize RecordCount = Rs_tmp.RecordCount TotalPage = INT (RecordCount / PageSize * -1) * - 1 PageNo = Request. QueryString ("Pageno") 'Direct input page number jump; if Request.form ("Pageno") <> "" "" Pageno ")' If you do not choose the shortline, the default is displayed One page; if pageno = "" "" The Pageno = 1 if RecordCount <> 0 THEN RS_TMP.ABSOLUTEPAGE = Pageno End if 'Get the current file name so that each page will be done in the current page; DIM filename, post finename = Request. ServerVariables ("script_name") Postion = INSTRREV (filename, "/") 1 'gets the current file name, point the page link to the current file; filename = MID (FileName, Postion)%>