对于ASP下的分页问题
来源:互联网 发布:淘宝二维码生成器 编辑:程序博客网 时间:2024/04/29 09:16
对于分页网上有不少说法,而最终我还是喜欢要用如下的方式进行。在这个基础上还是需要思考将代码固化与独立的问题,以便减少引用时的重复性!!
<body bgcolor="#4B9385"><div id="dv1"><form method="post"><table width="1048" height="25" border="0"><tr><th width="286"><strong class="t">申请单号</strong> <input type="text" name="vNid" /></th><th width="287"><strong class="t">收款方</strong> <input type="text" name="v1" /></th><th width="213"><strong class="t">摘要</strong> <input type="text" name="v3" /></th><th width="244"><strong class="t">申请人</strong> <input type="text" name="v5" /></th></tr><tr> <th><strong class="t">备注</strong> <input type="text" name="v4"/></th> <th><input type="checkbox" value="1" name="p1"/> <strong class="t">是否审核</strong> <input type="checkbox" value="1" name="p2"/> <strong class="t">是否审批</strong> <input type="checkbox" value="1" name="p3"/> <strong class="t">是否支付</strong></th> <th><input type="submit" value="查询" /> </th> <th> </th> </tr></table></form></div><%dim sWset Rbx=server.CreateObject("adodb.recordset")if request.form("vNid")<>"" thensW=" (rtrim(vNid) like '%"+trim(request.form("vNid"))+"%')"elsesW=" (1=1)"end ifif request.form("v1")<>"" thensW=sW & " and (rtrim(v1) like '%"+trim(request.form("v1"))+"%')"end ifif request.form("v3")<>"" thensW=sW & " and (rtrim(v3) like '%"+trim(request.form("v3"))+"%')"end ifif request.form("v4")<>"" thensW=sW & " and (rtrim(v4) like '%"+trim(request.form("v4"))+"%')"end ifif request.form("v5")<>"" thensW=sW & " and (rtrim(vx1) like '%"+trim(request.form("v5"))+"%')"end ifif request.form("p1")=1 thensW=sW & " and (isnull(vx2,N'')<>N'')"end ifif request.form("p2")=1 thensW=sW & " and (isnull(vx3,N'')<>N'')"end ifif request.form("p3")=1 thensW=sW & " and (isnull(vx4,N'')<>N'')"end ifPgSz=20 '设定开关,指定每一页所显示的帖子数目,默认为20帖一页Set RS = Server.CreateObject("ADODB.RecordSet")sql = "SELECT * FROM bxv where " + SW'查询所有帖子,并按帖子的ID倒序排列RS.open sql,cN,1,1If RS.RecordCount=0 then response.write "<P><center>对不起,数据库中没有相关信息!</center></P>" else RS.PageSize = Cint(PgSz) '设定PageSize属性的值 Total=INT(RS.recordcount / PgSz * -1)*-1 '计算可显示页面的总数 PageNo=Request("pageno") if PageNo="" Then PageNo = 1 else PageNo=PageNo+1 PageNo=PageNo-1 end if ScrollAction = Request("ScrollAction") if ScrollAction = " 上一页 " Then PageNo=PageNo-1 end if if ScrollAction = " 下一页 " Then PageNo=PageNo+1 end if if PageNo <1 Then PageNo = 1 end if n=1 RS.AbsolutePage = PageNo Response.Write "<CENTER>" position=RS.PageSize*PageNo pagebegin=position-RS.PageSize+1 if position <RS.RecordCount then pagend=position else pagend= RS.RecordCount end if %><TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0 BGCOLOR=#FFFFFF color=#F00 class="tx"><TR class="t2"><TD><B>序号</B></TD><TD><B>申请单号</B></TD><TD><B>收款方</B></TD><TD><B>款项</B></TD><TD><B>摘要</B></TD><TD><B>备注</B></TD><TD><B>申请情况</B></TD><TD><B>审核情况</B></TD><TD><B>审批情况</B></TD><TD><B>支持情况</B></TD><TR><% Do while not (RS is nothing) RowCount = RS.PageSize Do While Not RS.EOF and rowcount > 0 If n=1 then Response.Write "<TR BGCOLOR=#FFFFFF>" ELSE Response.Write "<TR BGCOLOR=#EEEEEE>" End If n=1-n %> <TD><span style="font-size:9pt"><% =RS("id")%></span></td> <TD><span style="font-size:9pt"><% =RS("vNid")%></span> </TD> <TD><span style="font-size:9pt"><% =RS("v1")%></span> </td> <TD><span style="font-size:9pt"><% =RS("v2")%></span> </td> <TD><span style="font-size:9pt"><% =RS("v3")%></span> </td> <TD><span style="font-size:9pt"><% =RS("v4")%></span> </td> <TD><span style="font-size:9pt"><% =RS("vx1")%></span> </td> <TD><span style="font-size:9pt"><% =RS("vx2")%></span> </td> <TD><span style="font-size:9pt"><% =RS("vx3")%></span> </td> <TD><span style="font-size:9pt"><% =RS("vx4")%></span> </td> </TR> <% RowCount = RowCount - 1 RS.MoveNext Loop set RS = RS.NextRecordSet Loop cN.Close set rs = nothing set cN = nothing%></TABLE><FORM method="get" action="#"><INPUT TYPE="HIDDEN" NAME="pageno" VALUE="<% =PageNo %>"><% if PageNo > 1 Then response.write "<INPUT TYPE=SUBMIT NAME='ScrollAction' VALUE=' 上一页 '>" end if if RowCount = 0 and PageNo <>Total then response.write "<INPUT TYPE=SUBMIT NAME='ScrollAction' VALUE=' 下一页 '>" end if End if%></FORM></body>
0 0
- 对于ASP下的分页问题
- 对于分页的理解
- ASP.net大数据量下的分页
- asp.net中分页的问题
- 对于分页的封装类
- 对于ASP编码问题的深入研究与最终解决方案
- 对于ASP编码问题的深入研究与最终解决方案
- asp.net 分页问题
- asp.net分页问题
- 对于UITableViewCell的selectedBackgroundView 在group模式下的问题
- 解决MVC下分页显示的问题
- 解决MVC下分页显示的问题
- 对于Ubuntu下无法自动获取ipv6的问题
- 关于c和CPP下对于const 常量的问题
- 对于 分布式下session同步问题 解决方案的思考
- 【分享】一个Asp.net mvc下的分页控件MvcPagerX
- 对于常用分页功能的总结
- 对于分页的两种方法
- C++11 range for 遍历多维数组, 迭代变量添加引用 "&"的问题
- 感情宣泄
- 黑马程序员—网络编程
- C#中的线程(一)入门
- BadUsb----结合实例谈此类外设的风险
- 对于ASP下的分页问题
- 时间没有动,我们在流逝。今天又是崭新的一天了,无论如何告诉自己,我太喜欢上班了,我太喜欢上学了。为了最爱的人最爱的事奋斗吧么么哒!!!
- 计算机图形学——基于3D游戏开发技术——第一章游戏模型
- 【bzoj3611】【大工程】【虚树+dp】
- Android应用程序如何进行系统签名
- OpenWrt的luci web管理器添加新菜单(二)
- 快速排序
- android&java 正则表达式
- 安装scrapy时碰壁:'[twisted] CRITICAL: Unhandled error in Deferred'