手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网络编程>Asp编程>列表

ASP通用分页类

来源:互联网 作者:west263.com 时间:2008-02-23
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

End If
End Property

'*****************************************
' 类型: 属性
' 目的: 设置需要显示的数据的字段名
' 输入: a_strFldName:字段名字符串,多个字段之间以逗号分隔
' 返回: 无
'*****************************************
Public Property Let FieldList(a_strFldName)
Dim strError

SW_blnFieldList = false
If Trim(a_strFldName) <> "" Then
SW_aryFldName = Split(LCase(a_strFldName),",")
Else
strError = strError & "<br>你必须设置需要显示的字段名,否则无法显示数据"
End If
If Trim(strError)="" Then
SW_blnFieldList = true
Else
SW_strError = SW_strError & " <tr bgcolor=""#336699"" height=""28""><td><font color=""#FFFFFF"">FieldList属性:</font></td></tr>" & vbcrlf
SW_strError = SW_strError & " <tr bgcolor=""#ffffff""><td>" & strError & "</td></tr>" & vbcrlf
End If
End Property

'*****************************************
' 类型: 属性
' 目的: 设定或显示每页的记录数。
' 输入: a_intPageSize: 每页显示的记录数。
' 返回: 每页显示的记录数。
'*****************************************
Public Property Let PageSize(a_intPageSize)
Dim strError

'PageSize获取失败标志
SW_blnPageSize = false
If Trim(a_intPageSize) = "" OR (Not(IsNumeric(a_intPageSize))) Then
strError = strError & "<br>非法的pagesize"
Else
If (a_intPageSize <= 2147483647 And a_intPageSize>=-2147483648) Then
SW_intPageSize = CLng(a_intPageSize)
Else
strError = strError & "<br>PageSize溢出"
End If
If (SW_intPageSize<=0) Then
strError = strError & "<br>PageSize只能是正整数"
End If
End If
If Trim(strError)="" Then
SW_blnPageSize = True
Else
SW_strError = SW_strError & " <tr bgcolor=""#336699"" height=""28""><td><font color=""#FFFFFF"">PageSize属性:</font></td></tr>" & vbcrlf
SW_strError = SW_strError & " <tr bgcolor=""#ffffff""><td>" & strError & "</td></tr>" & vbcrlf
End If
End Property

'*****************************************
' 类型: 属性
' 目的: 设定分页文件显示模板信息。
' 输入: a_strTemplate: 模板描述。
' 返回: 无。
'*****************************************
Public Property Let Template(a_strTemplate)
Dim aryTemplate,i,j,strError,strTemp,intItem,aryTemp,aryTemp1

SW_blnTemplate = false

aryTemplate = Split(Trim(LCase(a_strTemplate))," ")
intItem = UBound(aryTemplate)
If intItem < 4 Then strError = "<br>此属性是必选项"

If intItem < 4 Then
'获取文件头
strTemp = TriM(aryTemplate(0))

If strcomp(Left(strTemp,6),"[file=")= 0 Then
SW_strHeadJS = "<script src=""" & Mid(strTemp,7,Len(strTemp)-7) & """></script>"
Else
SW_strHeadJS = Mid(strTemp,7,Len(strTemp)-7)
End If

'获取文件尾
strTemp = Trim(aryTemplate(3))

If strComp(Left(strTemp,6),"[file=") = 0 Then
SW_strFootJS = "<script src=""" & Mid(strTemp,7,Len(strTemp)-7) & """></script>"
Else
SW_strFootJS = Mid(strTemp,7,Len(strTemp)-7)
End If

'获取分页模版
aryTemp = Split(aryTemplate(1),",")
If aryTemp(0) <> "" Then strTemp = Replace(aryTemp(0),"[page=","")

If IsNumeric(strTemp) Then strTemp = CInt(strTemp)
If strTemp <> SW_intPageInNone Then

If IsNumeric(strTemp) Then strTemp = CInt(strTemp)

SW_intShowPagePos = strTemp
strTemp = aryTemp(1)
If strTemp <> "" Then strTemp = Replace(strTemp,"]","")

If IsNumeric(strTemp) Then strTemp = CInt(strTemp)
SW_intShowPageType = strTemp
Else
SW_intShowPagePos = SW_intPageShowInNone
End If

'获取数据显示模版
aryTemp = Split(aryTemplate(2),"|")
For i = 0 To UBound(aryTemp)
strTemp = LCase(Trim(aryTemp(i)))
Select Case i
Case 0 '获取并设置显示宽度
If strTemp <> "" Then strTemp = Replace(strTemp,"[data=","")
SW_strShowWidth = strTemp
Case 1 '获取数据显示方式
If IsNumeric(strTemp) Then strTemp = CInt(strTemp)
SW_intShowType = strTemp
Case 2
If strTemp <> "" Then strTemp = Replace(strTemp,"]","")
aryTemp1 = Split(Trim(strTemp),"#")
If UBound(aryTemp1) >= 3 Then
SW_aryFldNote = Split(aryTemp1(0),",")
SW_aryFldAlign = Split(aryTemp1(1),",")
SW_aryFldWidth = Split(aryTemp1(2),",")
SW_aryFldLink = Split(aryTemp1(3),",")
End If
End Select
Next
End If

If strError = "" Then
SW_blnTemplate = true
Else
SW_strError = SW_strError & " <tr bgcolor=""#336699"" height=""28""><td><font color=""#FFFFFF"">Template属性:</font></td></tr>" & vbcrlf
SW_strError = SW_strError & " <tr bgcolor=""#ffffff""><td>" & strError & "</td></tr>" & vbcrlf
End If
End Property

'*****************************************

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!