校园学生学习娱乐资源第一门户 校园第一站 源于校园 服务于校园 分享资源和快乐 网站地图 高级搜索 RSS订阅 收藏本站 设为首页
首页 | 校园 | 教育 | 考试 | 电脑 | 英语 | 读书 | 就业 | 论文 | 体育 | 健康 | 图片 | 分类信息
Q Q | 下载 | 游戏 | 音乐 | 影视 | 专题 | 祝福 | 百科 | 问答 | 博客 | 会员 | 社区 | 校园论坛
·偶像剧免费在线收看
·DEDECMS免费模板规则下载
·
·全能空间、网站建设仅200
XML | 文章搜索:
  当前位置: 主页>电脑>网络编程>ASP> 文章正文

asp分页代码

http://www.xydyz.com 来源:校园第一站 2007-10-23 阅读: 评论


<%''+++++++++++++++++++++++++++++++++++++++++++++++++++++++
''调用例子
'Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo
'int_RPP=2 '设置每页显示数目
'int_showNumberLink_=8 '数字导航显示数目
'showMorePageGo_Type_ = 1 '是下拉菜单还是输入值跳转,当多次调用时只能选1
'str_nonLinkColor_="#999999" '非热链接颜色
'toF_="<font face=webdings>9</font>"     '首页
'toP10_=" <font face=webdings>7</font>"   '上十
'toP1_=" <font face=webdings>3</font>"   '上一
'toN1_=" <font face=webdings>4</font>"   '下一
'toN10_=" <font face=webdings>8</font>"   '下十
'toL_="<font face=webdings>:</font>"    '尾页

'============================================
'这段代码一定要在VClass_Rs.Open 与 for循环之间
' Set VClass_Rs = CreateObject(G_FS_RS)
' VClass_Rs.Open This_Fun_Sql,User_Conn,1,1
' IF not VClass_Rs.eof THEN
' VClass_Rs.PageSize=int_RPP
' cPageNo=NoSqlHack(Request.QueryString("Page"))
' If cPageNo="" Then cPageNo = 1
' If not isnumeric(cPageNo) Then cPageNo = 1
' cPageNo = Clng(cPageNo)
' If cPageNo<=0 Then cPageNo=1
' If cPageNo>VClass_Rs.PageCount Then cPageNo=VClass_Rs.PageCount
' VClass_Rs.AbsolutePage=cPageNo
'   FOR int_Start=1 TO int_RPP
   ''++++++++++
   '加循环体显示数据
   ''++++++++++
'  VClass_Rs.MoveNext
'  if VClass_Rs.eof or VClass_Rs.bof then exit for
'      NEXT
' END IF  
'============================================
'response.Write "<p>"&  fPageCount(VClass_Rs,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,cPageNo)

''++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'*********************************************************
' 目的:分页的页面参数保持
'          提交查询的一致性
' 输入:moveParam:分页参数
'         removeList:要移除的参数
' 返回:分页Url
'*********************************************************
Function PageUrl(moveParam,removeList)
 dim strName
 dim KeepUrl,KeepForm,KeepMove
 removeList=removeList&","&moveParam
 KeepForm=""
 For Each strName in Request.Form
  '判断form参数中的submit、空值
  if not InstrRev(","&removeList&",",","&strName&",", -1, 1)>0 and Request.Form(strName)<>"" then
   KeepForm=KeepForm&"&"&strName&"="&Server.URLencode(Request.Form(strName))
  end if
  removeList=removeList&","&strName
 Next
 
 KeepUrl=""
 For Each strName In Request.QueryString
  If not (InstrRev(","&removeList&",",","&strName&",", -1, 1)>0) Then
   KeepUrl = KeepUrl & "&" & strName & "=" & Server.URLencode(Request.QueryString(strName))
  End If
 Next
 
 KeepMove=KeepForm&KeepUrl
 
 If (KeepMove <> "") Then
   KeepMove = Right(KeepMove, Len(KeepMove) - 1)
   KeepMove = Server.HTMLEncode(KeepMove) & "&"
 End If
 
 'PageUrl = replace(Request.ServerVariables("URL"),"/Search.asp","/Search.html") & "?" & KeepMove & moveParam & "="
 PageUrl =  "?" & KeepMove & moveParam & "="
End Function


Function fPageCount(Page_Rs,showNumberLink_,nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_,Page)

Dim This_Func_Get_Html_,toPage_,p_,sp2_,I,tpagecount
Dim NaviLength,StartPage,EndPage

This_Func_Get_Html_ = ""  : I = 1  
NaviLength=showNumberLink_

if IsEmpty(showMorePageGo_Type_) then showMorePageGo_Type_ = 1
tpagecount=Page_Rs.pagecount
If tPageCount<1 Then tPageCount=1

if not Page_Rs.eof or not Page_Rs.bof then

toPage_ = PageUrl("Page","submit,GetType,no-cache,_")

if Page=1 then
 This_Func_Get_Html_=This_Func_Get_Html_& "<font color="&nonLinkColor_&" title=""首页"">"&toF_&"</font> " &vbNewLine




【责任编辑:admin 】

共3页: 上一页 1 [2] [3] 下一页



评论
用户名: 新注册) 密码: 匿名评论
评论内容:不能超过250字,请自觉遵守互联网相关政策法规。
  相关文章
学习ASP有用的代码
新手入门:防范SQL注入攻击的新办法
ASP用Server.Transfer实现博客永久链接
ASP函数库
ASP日期和时间函数示例
  最新图片
为自己的ASP网站系统构建一套标记语言
为自己的ASP网站系统
24小时TOP
   
·AspJpeg组件下载注册码及用途
·“Operation Must Use an Updateable Query
·Web在线代理(Asp版)
·用文本+ASP打造新闻发布系统
·ASP二进制流方法隐藏图片文件真实地址
·ASP函数库
·彻底解决“Microsoft JET Database Engine
·UTF-8怎么转GB2312?
热门图片
  更多>>>
为自己的ASP网站系统构建一套标记语言
为自己的ASP网站系
焦点聚焦
  更多>>>
 
论坛精华
  更多>>>
·真钱斗地主轧金花龙虎板玖和百家乐http://c
·22岁女大学生要嫁48岁乞丐(图)
·一条短信毁了一种水果 “蛆橘”传言流变调
·蒙古风情十四怪 (一)
·《中国高新技术企业》--www.txrb.com--科信
·东莞大金空调官方介绍 13559702882卢生
·乐众国际最新博彩游戏!真实!新鲜!刺激!
·快国庆了大家怎么安排
最新图片
  更多>>>
为自己的ASP网站系统构建一套标记语言
为自己的ASP网站系
推荐文章
  更多>>>
·为自己的ASP网站系统构建一套标记语言
关于我们 - 版权声明 - 免责声明 - 欢迎投稿 - 广告服务 - 友情链接 - 网站建设 - 诚聘英才 - 联系我们 - -
Copyright @2007-2009 www.xydyz.com © All rights reserved.
校园第一站 版权所有 客服E-Mail:hyperblue@163.comn 点击这里给我发消息
Site design by hyperblue 鄂ICP备07009403号 Powered by DedeCms