分页类Pager
来源:ASP学习网 作者:Admin 时间:08-04-24 点击:
分页类Pager
<%
Class Pager
Private IUrl
Private IPage
Private IParam
Private IPageSize
Private IPageCount
Private IRecordCount
Private ICurrentPageIndex
Public Property Let Url(ByVal PUrl)
IUrl = PUrl
End Property
Public Property Get Url()
If IUrl = "" Then
If Request.QueryString <> "" Then
Dim query
For Each key In Request.QueryString
If key <> Param Then
query = query & key & "=" & Server.UrlEnCode(Request.QueryString(key)) & "&"
End If
Next
IUrl = Page & "?" & query & Param & "="
Else
IUrl = Page & "?" & Param & "="
End If
End If
Url =IUrl
End Property
Public Property Let Page(ByVal PPage)
IPage = PPage
End Property
Public Property Get Page()
Page = IPage
End Property
Public Property Let Param(ByVal PParam)
IParam = PParam
End Property
Public Property Get Param()
Param = IParam
End Property
Public Property Let PageSize(ByVal PPageSize)
IPageSize = PPageSize
End Property
Public Property Get PageSize()
PageSize = IPageSize
End Property
Public Property Get PageCount()
If (Not IPageCount > 0) Then
IPageCount = IRecordCount \ IPageSize
If (IRecordCount MOD IPageSize) > 0 Or IRecordCount = 0 Then
IPageCount = IPageCount + 1
End If
End If
PageCount = IPageCount
End Property
Public Property Let RecordCount(ByVal PRecordCount)
IRecordCount = PRecordCount
End Property
Public Property Get RecordCount()
RecordCount = IRecordCount
End Property
Public Property Let CurrentPageIndex(ByVal PCurrentPageIndex)
ICurrentPageIndex = PCurrentPageIndex
End Property
Public Property Get CurrentPageIndex()
If ICurrentPageIndex = "" Then
If Request.QueryString(Param) = "" Then
ICurrentPageIndex = 1
Else
If IsNumeric(Request.QueryString(Param)) Then
ICurrentPageIndex = CInt(Request.QueryString(Param))
If ICurrentPageIndex <