Asp学习站欢迎你!

分页类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 <

标签: 分页】 【打印】 【关闭
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 验证码: 验证码 查看所有评论