Here's how to calculate the total number of pages when I find three ASP pages from the Web, this method calculates the total number of pages when paging, not the entire paging code:
Method One
Copy Code code as follows:
' Htmer_recordcount the total number of pages to be calculated
' Htmer_recordcount is the number of recordsets
' Htmer_pagesize the number of records per page
If htmer_recordcount Mod htmer_pagesize=0 Then
Htmer_pagecount=int (Htmer_recordcount/htmer_pagesize)
Else
Htmer_pagecount=int (htmer_recordcount/htmer_pagesize) +1
End If
Method Two
Copy Code code as follows:
' Htmer_recordcount the total number of pages to be calculated
' Htmer_recordcount is the number of recordsets
' Htmer_pagesize the number of records per page
Htmer_pagecount=int (htmer_recordcount/htmer_pagesize*-1) *-1
Method Three
Copy Code code as follows:
' Htmer_recordcount the total number of pages to be calculated
' Htmer_recordcount is the number of recordsets
' Htmer_pagesize the number of records per page
Htmer_pagecount=abs (Int (-(htmer_recordcount/htmer_pagesize))
Method Four
Copy Code code as follows:
' Htmer_recordcount the total number of pages to be calculated
' Htmer_recordcount is the number of recordsets
' Htmer_pagesize the number of records per page
Htmer_pagecount=fix (htmer_recordcount/htmer_pagesize)-cint (CBool (htmer_recordcount Mod HTMer_PageSize))