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

ASP通用分页类

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

Response.Write(" <table class=""css_showdata_tb"" align=""center"" width=""" & SW_strShowWidth & """>" & vbcrlf)
Response.Write(" <tr class=""css_title""><td colspan=""" & CStr(UBound(SW_aryFldName) 1) & """>" & vbcrlf)
Response.Write(" <table border=""0"" width=""100%""><tr>")
For i = LBound(SW_aryFldName) To UBound(SW_aryFldName)
Response.Write(" <td align=""center""")
If (IsArray(SW_aryFldWidth)) Then Response.Write(" width=""" & SW_aryFldWidth(i) & """>")
If (IsArray(SW_aryFldNote)) Then
Response.Write(SW_aryFldNote(i) & vbcrlf)
Else
Response.Write(SW_aryFldName(i) & vbcrlf)
End If
Response.Write(" </td>" & vbcrlf)
Next
Response.Write(" </tr></table></td></tr>" & vbcrlf)
Else
Response.Write(" <table class=""css_showdata_tb"" width=""" & SW_strShowWidth & """ align=""center"">" & vbcrlf)
Response.Write(" <tr class=""css_Title"" height=""28"">" & vbcrlf)
For i = LBound(SW_aryFldName) To UBound(SW_aryFldName)
Response.Write(" <td class=""css_showdata_td"" align=""center""")
If (IsArray(SW_aryFldWidth)) Then Response.Write(" width=""" & SW_aryFldWidth(i) & """>")
If (IsArray(SW_aryFldNote)) Then
Response.Write(SW_aryFldNote(i))
Else
Response.Write(SW_aryFldName(i))
End If
Response.Write(" </td>" & vbcrlf)
Next
Response.Write(" </tr>" & vbcrlf)
End If

Do While (Not SW_objRS.Eof AND j<SW_intPageSize)
Response.Write(" <tr class=""CSS_ShowData_tr"" height=""28"">" & vbcrlf)
For i = LBound(SW_aryFldName) To UBound(SW_aryFldName)
Response.Write( "<td class=""css_showdata_td""")
If (IsArray(SW_aryFldAlign)) Then Response.Write(" align=""" & SW_aryFldAlign(i) & """ width=""" & SW_aryFldWidth(i) & """>")
If (IsArray(SW_aryFldLink) AND Trim(SW_aryFldLink(i)<>"")) Then
Response.Write(" <a href=""" & SW_aryFldLink(i) & """ target=""_blnak"">" & SW_objRS(SW_aryFldName(i)) & "</a></td>")
Else
Response.Write(SW_objRS(SW_aryFldName(i)) & " </td>" & vbcrlf)
End If
Next

Response.Write(" </tr>" & vbcrlf)
SW_objRS.MoveNext
j = j 1
Loop
Response.Write(" </table>" & vbcrlf)
Response.Write("<table><tr><td height=""5""></td></tr></table>" & vbcrlf)
CASE ELSE
Response.Write("<br>你还没设置数据的显示方式?或者你的设置的显示方式SWPage不支持!<br>")
Response.End
End SELECT
If SW_intShowPagePos = SW_intPageInAll Or SW_intShowPagePos = SW_intPageInBottom Then Call Pages()
Response.Write( SW_strFootJS & vbcrlf)
End If
End Sub

'*****************************************
' 类型: 过程
' 目的: 显示分页类中出现的错误信息
' 输入: 无
' 返回: 无
'*****************************************
Private Sub ShowErrors()
If SW_strError <> "" Then
SW_strError = "<table bgcolor=""#0000"" cellspacing=""1"" cellpadding=""0"" width=""90%"" align=""center"">" & vbcrlf & " <tr bgcolor=""#ff9900"" height=""30""><td align=""center"" valign=""middle""><b>SWPage分页类错误信息<b></td></tr>" & vbcrlf & SW_strError & "</table>" & vbcrlf
Response.Write(SW_strError)
Response.End
End If
End Sub

'*****************************************
' 类型: 过程
' 目的: 释放资源
' 输入: 无
' 返回: 无
'*****************************************
Sub Close()
Set SW_objRS = Nothing
Set SW_objConn = Nothing
End Sub
End Class
%>

  三、类的应用代码

<%Option Explicit
Dim strStartTime,intUseTime,clsPage,strShowTemp
strStartTime = timer()
%>
<!--#include file="inc_clsPages.asp"-->
<%
'分页显示的位置:SW_intPageInAll,SW_intPageInTop,SW_intPageInBottom
'页数的显示模式:SW_intShowChinese,SW_intShowEnglish,SW_intShowCharacter,SW_intShowImage
'页面显示模板设置 <文件头> <页数设置:分页显示模式,页数显示的位置> <数据显示> <页数显示> <文件尾>如果某项不需要,只要设置成<>就行了,不过<文件头>和<文件尾是必须的>

'设置分页文件头,可以直接跟HTML代码({code=<html>....</html>})
strShowTemp = "[file=head.js] "
'设置分页条显示信息
strShowTemp = strShowTemp & "[page=" & SW_intPageInAll & "," & SW_intShowCharacter & "] "

'########设置数据模版信息
strShowTemp = strShowTemp & "[data="
'设置显示的宽度
strShowTemp = strShowTemp & "90%|"
'数据显示方式,竖排、横排
strShowTemp = strShowTemp & SW_intVerticalView & "|"

'需要显示的字段的相应的中文说明
strShowTemp = strShowTemp & "编号,用户名,生日#"
'需要显示的字段的相应的对齐方式
strShowTemp = strShowTemp & "left,center,right#"

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