class CPageCtrl
public tip, tablewidth
private setobjflag, rsobj, pages, record, setparamsflag, current, topage
dim params()
'----------------------------------
private sub class_initialize()
tablewidth = "100%"
end sub
'---------------------------------
public function SetRsObj(obj)
set rsobj = obj
setobjflage = true
end function
'----------------------------------
private function chksetobj()
if setobjflage <> true then response.End()
end function
'----------------------------------
public function DimPage(psize) '分页界说
dim topages
topage = request("topage")
if not rsobj.eof then
if not isempty(psize) then
rsobj.pagesize = cint(psize) '界说每页显示数量
else
rsobj.pagesize = rsobj.recordcount
end if
pages = rsobj.pagecount
record = rsobj.recordcount
if topage <> empty then
topages = CInt(topage)
if topage <= 1 then
rsobj.absolutepage = 1
elseif topages >= pages then
rsobj.absolutepage = pages
else
rsobj.absolutepage = topages
end if
end if
current = rsobj.absolutepage
end if
end function
'----------------------------------
public function SetParams(arrParams())
params = arrParams
setparamsflag = true
end function