|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
<% set con=server.CreateObject("ADODB.Connection") strConnection="Data Source=xxxxxxx;" con.Open strConnection set rs = Server.CreateObject("ADODB.Recordset") chartSQL="select ID,name,category_one from goods " rs.Open chartSQL,con,1,3 if rs.EOF or rs.BOF then \\\'假如为空 response.end end if pagesize=10 \\\'每页显示10条记录 pagecuont=rs.PageCount \\\'总页数 recordcount=rs.RecordCount dim pagenum \\\'当前页码 dim currentRecord \\\'当前页的记录数,对于末页其值不等于pagesize if Request.QueryString ("pageNum")="" then pageNum=1 else pageNum=Request.QueryString ("pageNum") rs.AbsolutePage =trim(Request.QueryString ("pageNum")) end if %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> <SCRIPT LANGUAGE=javascript> <!-- function openwindow(url){ window.open(url,\\\'\\\',\\\'resizable=no,width=240,height=160,fullscreen=yes\\\') } //--> </SCRIPT> <link rel="stylesheet" href="file:///F|/mysourceof17560/CSS.CSS" type="text/css"> </head> <body bgcolor=#999999> <p align="center">商品修改页面</p> <table border="1" width="100%" cellpadding="0" cellspacing="0" bordercolordark="#999999" bordercolorlight="#000000"> <tr> <td width="10%"> <div align="center">编号 </div> </td> <td width="63%"> <div align="center">商品名 </div> </td> <td width="14%"> <div align="center">主分类</div> </td> <td width="13%"> <div align="center">操作 </div> </td> </tr> <% for i=1 to rs.PageSize if rs.EOF or rs.BOF then \\\'本条件判定是否到了尽头 exit for end if %> <tr> <td width="10%" align=center><%=rs("ID")%></td> <td width="63%" align=center><%=rs("name")%> </td> <td width="14%" align=center><%=rs("category_one")%> </td> <td width="13%"> <div align="center"> <INPUT type="button" value="Button" id=button1 name=button1 onclick="javascript:window.open(\\\'tomodify.asp?id=<%=rs("ID")%>&zfenlei=<%=rs("category_one")%>\\\',\\\'\\\',\\\'resizable=no,width=240,height=160\\\')"> </div> </td> </tr> <% currentRecord=currentRecord+1 \\\'取的当前页的记录数 rs.MoveNext next rs.Close %> </table> <div align="center" class="bfont">合计<%=recordCount%> 条记录 | 第 <% pageNum_record=(pageNum-1)*pageSize+1 \\\'初始记录位置 pageNum_record_=pageNum_record+currentRecord-1 \\\'末记录位置 Response.Write pageNum_record %> -<%=pageNum_record_%>条 | 第<%=pageNum%>页 |共<%=pagecuont%>页 <% if pagecuont >0 then \\\'防止当前返回的为空记录,即数据库中该数据集为空 if pageNum > 1 then %> <a href="modifychart.asp?pageNum=1"> <font color="#FFFFFF">首页</font></a> <% else Response.Write "首页" end if if pageNum > 10 then \\\'如有需要,请在这里添上假如不足10页时该实现前n页的代码, \\\'请参考下面的假如后面不足10页时该怎么样处理的代码和思路 %> <a href="modifychart.asp?pageNum=<%=(pageNum-10)%>"> <font color="#FFFFFF">前10页</font></a> <% end if if (pageNum+10) < pagecuont then \\\'这里也一样参考下面的思路 %> <a href="modifychart.asp?pageNum=<%=(pageNum+10)%>"> <font color="#FFFFFF">下10页</font></a> <% end if if (pageNum+10) < pagecuont then \\\'这里判定后面是否还有10页 endpage=pageNum+9 else endpage=pageCount end if for i=pageNum to endPage %> <a href="modifychart.asp?pageNum=<%=i%>">第<%=i%>页</a> <% next if pageNum <> pageCount then %> <a href="modifychart.asp?pageNum=<%=pagecuont%>"> <font color="#FFFFFF">末页</font></a> <% end if end if \\\'end of --->if pageCount >0 then %> </div> </body> </html> 返回类别: 教程 上一教程: 建立一个广告交换及跟踪系统 下一教程: 具有EDIT功能的COMBOBOX 您可以阅读与"分页的显示-->前后翻滚10页的实现"相关的教程: · 分页的显示-->前后翻滚10页的实现 · 分栏显示记录集的表格演示,并实现了分页 · 用ASP实现分页的源码 · 在ASP中通过GETROWS实现数据库记录分页的一段代码 · ASP中通过GETROWS实现数据库记录分页的一段代码 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |