下面是我從網上找到三種ASP分頁時計算頁面總數的方法,此方法僅為分頁時計算頁面總數,並非整個分頁代碼:
方法一
復制代碼 代碼如下:
' HTMer_RecordCount為要計算的頁面總數
' HTMer_RecordCount為記錄集數
' HTMer_PageSize為每頁記錄數
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
方法二
復制代碼 代碼如下:
' HTMer_RecordCount為要計算的頁面總數
' HTMer_RecordCount為記錄集數
' HTMer_PageSize為每頁記錄數
HTMer_PageCount=Int(HTMer_RecordCount/HTMer_PageSize*-1)*-1
方法三
復制代碼 代碼如下:
' HTMer_RecordCount為要計算的頁面總數
' HTMer_RecordCount為記錄集數
' HTMer_PageSize為每頁記錄數
HTMer_PageCount=Abs(Int(-(HTMer_RecordCount/HTMer_PageSize)))
方法四
復制代碼 代碼如下:
' HTMer_RecordCount為要計算的頁面總數
' HTMer_RecordCount為記錄集數
' HTMer_PageSize為每頁記錄數
HTMer_PageCount=Fix(HTMer_RecordCount/HTMer_PageSize)-CInt(CBool(HTMer_RecordCount Mod HTMer_PageSize))