分页表示函数(1)

调用:showPageList(Total,PageSize,Currentpage,5,"Display.asp?RentType="&RentType&"&cityid="&AreaID&"&page=$")
'***********************************************************
'分页显示 [ 共 15 页 ] << < 第 6 7 8 9 10 页 > >>  2005年4月12日
'***********************************************************
Function showPageList(iTotal,iPagesize,iCurrentpage,iListNum,strPageVar)
    dim pstr,totalpage,iCount,mTotal
        dim prePage,nextPage,iPage
                if (iTotal mod iPagesize > 0) then
                   totalpage = Fix(iTotal/iPagesize) + 1
                else
                   totalpage = iTotal/iPagesize
                end if
                if (iCurrentpage>totalpage) then iCurrentpage=totalpage
                if (iCurrentpage<1) then iCurrentpage = 1
                if (iCurrentPage <> 1) then
                   pStr = pStr & "<a href='"&Replace(strPageVar,"$",1)&"'>&lt;&lt;</a> "&" <a href='"&Replace(strPageVar,"$",iCurrentPage-1)&"'>&lt;</a> 第 "
                else
                   pStr = pStr & "&lt;&lt; "&" &lt; 第 "
                end if

                if (iListNum mod 2 = 0) then iListNum = iListNum+1
                mTotal = (iListNum+1)/2

                 for iCount=1 to iListNum
                   if iCount < mTotal then
                       iPage = iCurrentPage - (mTotal-iCount)
                       if iPage > 0 then
                                   pStr = pStr & " <a href='"&Replace(strPageVar,"$",iPage)&"'>"&iPage&"</a> "
                           end if
                   elseif iCount = mTotal then
                       pStr = pStr & " <strong>"&iCurrentPage&"</strong> "
                   else
                       iPage = iCurrentPage + (iCount-mTotal)
                           if iPage <= totalPage then
                                   pStr = pStr & " <a href='"&Replace(strPageVar,"$",iPage)&"'>"&iPage&"</a> "
                           end if
                   end if
                next

                if (iCurrentPage <> totalpage) then
                   pStr = pStr & "页 <a href='"&Replace(strPageVar,"$",iCurrentPage+1)&"'>&gt;</a> "&" <a href='"&Replace(strPageVar,"$",totalPage)&"'>&gt;&gt;</a>"
                else
                   pStr = pStr & "页 &gt; "&" &gt;&gt;"
                end if

       showPageList = "[ 共 "&totalPage&" 页 ] " & pStr
End Function
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值