您现在的位置是:网站首页> 编程资料编程资料
ShowPage 显示“上一页 下一页”等信息的封装代码_应用技巧_
2023-05-25
237人已围观
简介 ShowPage 显示“上一页 下一页”等信息的封装代码_应用技巧_
'**************************************************
'函数名:ShowPage
'作 用:显示“上一页 下一页”等信息
'参 数:sFileName ----链接地址
' TotalNumber ----总数量
' MaxPerPage ----每页数量
' ShowTotal ----是否显示总数量
' ShowAllPages ---是否用下拉列表显示所有页面以供跳转。有某些页面不能使用,否则会出现JS错误。
' strUnit ----计数单位
'返回值:“上一页 下一页”等信息的HTML代码
'**************************************************
function ShowPage(sFileName,TotalNumber,MaxPerPage,ShowTotal,ShowAllPages,strUnit)
dim TotalPage,strTemp,strUrl,i
if TotalNumber=0 or MaxPerPage=0 or isNull(MaxPerPage) then
ShowPage=""
exit function
end if
if totalnumber mod maxperpage=0 then
TotalPage= totalnumber \ maxperpage
Else
TotalPage= totalnumber \ maxperpage+1
end if
if CurrentPage>TotalPage then CurrentPage=TotalPage
strTemp= "
"
ShowPage=strTemp
end function
'函数名:ShowPage
'作 用:显示“上一页 下一页”等信息
'参 数:sFileName ----链接地址
' TotalNumber ----总数量
' MaxPerPage ----每页数量
' ShowTotal ----是否显示总数量
' ShowAllPages ---是否用下拉列表显示所有页面以供跳转。有某些页面不能使用,否则会出现JS错误。
' strUnit ----计数单位
'返回值:“上一页 下一页”等信息的HTML代码
'**************************************************
function ShowPage(sFileName,TotalNumber,MaxPerPage,ShowTotal,ShowAllPages,strUnit)
dim TotalPage,strTemp,strUrl,i
if TotalNumber=0 or MaxPerPage=0 or isNull(MaxPerPage) then
ShowPage=""
exit function
end if
if totalnumber mod maxperpage=0 then
TotalPage= totalnumber \ maxperpage
Else
TotalPage= totalnumber \ maxperpage+1
end if
if CurrentPage>TotalPage then CurrentPage=TotalPage
strTemp= "
| " if ShowTotal=true then strTemp=strTemp & "共 " & totalnumber & " " & strUnit & " " end if strUrl=JoinChar(sfilename) if CurrentPage<2 then strTemp=strTemp & "首页 上一页 " Else strTemp=strTemp & "首页 " strTemp=strTemp & "上一页 " end if if CurrentPage>=TotalPage then strTemp=strTemp & "下一页 尾页" Else strTemp=strTemp & "下一页 " strTemp=strTemp & "尾页" end if strTemp=strTemp & " 页次:" & CurrentPage & "/" & TotalPage & "页 " strTemp=strTemp & " " & maxperpage & "" & strUnit & "/页" if ShowAllPages=True then strTemp=strTemp & " 转到第页" 'strTemp = strTemp &" " end if strTemp=strTemp & " |
ShowPage=strTemp
end function
相关内容
- asp实现检查目录是否存在与建立目录的函数_应用技巧_
- ScriptHtml 函数之过滤html标记的asp代码_应用技巧_
- GetPaing 函数之asp采集函数中用到的获取分页的代码_应用技巧_
- FpHtmlEnCode 函数之标题过滤特殊符号的代码_应用技巧_
- SaveRemoteFile函数之asp实现保存远程的文件到本地的代码_应用技巧_
- ASP检查文件与目录是否存在的函数代码_应用技巧_
- ReplaceTrim 函数之asp实现过滤掉字符中所有的tab和回车和换行的代码_应用技巧_
- FormatRemoteUrl函数之asp实现格式化成当前网站完整的URL-将相对地址转换为绝对地址的代码_应用技巧_
- ASP+XML实例演练编程代码第1/3页_应用技巧_
- asp实现防止从外部提交数据的三种方法第1/3页_应用技巧_
