调用: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)&"'><<</a> "&" <a href='"&Replace(strPageVar,"$",iCurrentPage-1)&"'><</a> 第 " else pStr = pStr & "<< "&" < 第 " 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)&"'>></a> "&" <a href='"&Replace(strPageVar,"$",totalPage)&"'>>></a>" else pStr = pStr & "页 > "&" >>" end if showPageList = "[ 共 "&totalPage&" 页 ] " & pStr End Function
分页表示函数(1)
最新推荐文章于 2019-06-17 21:22:48 发布