国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

ShowPage 顯示“上一頁 下一頁”等信息的封裝代碼

2020-07-27 13:05:24
字體:
供稿:網(wǎng)友
'**************************************************
'函數(shù)名:ShowPage
'作  用:顯示“上一頁 下一頁”等信息
'參  數(shù):sFileName  ----鏈接地址
'       TotalNumber ----總數(shù)量
'       MaxPerPage  ----每頁數(shù)量
'       ShowTotal   ----是否顯示總數(shù)量
'       ShowAllPages ---是否用下拉列表顯示所有頁面以供跳轉(zhuǎn)。有某些頁面不能使用,否則會出現(xiàn)JS錯誤。
'       strUnit     ----計數(shù)單位
'返回值:“上一頁 下一頁”等信息的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= "<table align='center'><tr><td>"
    if ShowTotal=true then 
        strTemp=strTemp & "共 <b>" & totalnumber & "</b> " & strUnit & "&nbsp;&nbsp;"
    end if
    strUrl=JoinChar(sfilename)
      if CurrentPage<2 then
        strTemp=strTemp & "首頁 上一頁&nbsp;"
      Else
        strTemp=strTemp & "<a href='" & strUrl & "page=1'>首頁</a>&nbsp;"
        strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage-1) & "'>上一頁</a>&nbsp;"
      end if

      if CurrentPage>=TotalPage then
        strTemp=strTemp & "下一頁 尾頁"
      Else
        strTemp=strTemp & "<a href='" & strUrl & "page=" & (CurrentPage+1) & "'>下一頁</a>&nbsp;"
        strTemp=strTemp & "<a href='" & strUrl & "page=" & TotalPage & "'>尾頁</a>"
      end if
       strTemp=strTemp & "&nbsp;頁次:<strong><font color=red>" & CurrentPage & "</font>/" & TotalPage & "</strong>頁 "
        strTemp=strTemp & "&nbsp;<b>" & maxperpage & "</b>" & strUnit & "/頁"
    if ShowAllPages=True then
        strTemp=strTemp & "&nbsp;&nbsp;轉(zhuǎn)到第<input type='text' name='page' size='3' maxlength='5' value='" & CurrentPage & "' onKeyPress=""if (event.keyCode==13) window.location='" & strUrl & "page=" & "'+this.value;""'>頁"
         'strTemp  = strTemp &"&nbsp;<Input type=""button""  onClick=""window.location.href='" & strUrl & "page='+document.all.page.value;""  name=button1  value=GO >"
    end if
    strTemp=strTemp & "</td></tr></table>"
    ShowPage=strTemp
end function
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 新郑市| 邹城市| 肥城市| 南召县| 金堂县| 宁波市| 突泉县| 通道| 云南省| 壤塘县| 舟山市| 怀远县| 嵊州市| 明光市| 政和县| 鄂伦春自治旗| 措勤县| 长丰县| 疏附县| 菏泽市| 青铜峡市| 安图县| 恩平市| 太保市| 若尔盖县| 北川| 扎囊县| 健康| 岢岚县| 松溪县| 昂仁县| 涞水县| 新龙县| 北海市| 巩义市| 大英县| 宁河县| 金华市| 循化| 益阳市| 舞阳县|