内容显示页
 
类别:ASP+VBS | 浏览(137) | 2006-10-19 13:25:00 | 关闭广告

'***********************************************
'永法修改版
'函数名:SetPage;PrintPage
'作  用:分页函数
'应用:
'rs.open之后写上setpage(rs,pagecount,20)  
'For循环里记得写上
'<%
'rs.movenext
'if i>rs.PageSize then exit for
'next
'%>
'循环完后表格外写上:PrintPage(PageCount,rs,URL)
'***********************************************
Sub SetPage(rs,PageCount,PageSize)
 IF not rs.eof Then
  IF not isempty(Request("page")) Then
   IF IsNumeric(Request("page")) = True Then
    PageCount=cint(Request("page"))
   Else
     PageCount=1
   End IF
   Else
   PageCount=1
   End IF
   IF session("PageSize")="" or not IsNumeric(session("PageSize")) Then
   session("PageSize") = PageSize
   End IF
   rs.pagesize=session("PageSize")
   IF PageCount>rs.PageCount or PageCount<=0 Then             
   PageCount=1             
   End IF             
   IF not rs.eof Then rs.AbsolutePage=PageCount
 End IF
End  Sub

Sub PrintPage(pagecount, rs, URL)
 IF rs.pagecount > 0 Then
 str=pagecount&"/"&rs.pagecount&"&nbsp;"
 i=1
 Do While i<rs.pagecount+1
 IF i<> pagecount Then
 str=str&"<A href="&URL&"&page="&i&">"&i&"</A>&nbsp;"
 else
 str=str&"<font color=red>"&i&"</font>&nbsp;"
 End IF
 i=i+1
 Loop
 End IF
 response.Write str
End Sub


引用本页地址:http://www.yongfa365.com/item/2ce5352ed454c36d.html
 
上一篇:页面底部常用
下一篇:程序片断
 
相关链接
 
网友评论:
姓名: 记住我
网址:
邮箱:
内容:
验证码:  验证码图片看不清? 换张图试试
 
   
 
 
文章分类
 
   

Power by :柳永法(yongfa365)'Blog | Model by :hibaidu | CSS by:众网友 | 京ICP备07011491号  QQ:64049027  E-mail:64049027qq.com

本空间赞助商:北京中科兴联信息技术有限公司