• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    asp模塊化分頁制作詳解

    發布: 2007-7-14 19:37 | 作者: 佚名    | 來源: 網絡轉載     | 查看: 8次 | 進入軟件測試論壇討論

    領測軟件測試網

    模塊化分頁

    1.查詢語句塊

    <%
    取得當前文件名
    temp = Split(request.ServerVariables("URL"), "/")
    fy = temp(UBound(temp))
    set rs=server.createobject("adodb.recordset")
    if not isempty(request("page")) then  
    pagecount=cint(request("page"))  
    else  
    pagecount=1  
    end if
    sql="select  查詢語句"
    rs.open sql,conn,1,1
    rs.pagesize=10  分頁記錄數
    if pagecount>rs.pagecount or pagecount<=0 then             
    pagecount=1             
    end if            
    if rs.eof and rs.bof then%>

    <div align="center" class="001"><br>
    對不起,沒有符合搜索條件的記錄!<br>
    </div>

    2.顯示記錄塊

    <%
    else
    rs.AbsolutePage=pagecount
    do while not rs.eof %>

    顯示的記錄

    <% i=i+2
    rs.movenext
    if i>=rs.PageSize then exit do
    loop
    'www.knowsky.com
    %>

    3.
    分頁效果
    <table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr align="center">
        <% if rs.pagecount=1 then %>
        <td height="35" colspan="4" class=001><font color="#000000">共有[<font color="#ff0000"><%=rs.recordcount%></font>]條信息 當前顯示第 <font color="red">1~<%=rs.recordcount%></font>條</font></td>
      </tr>
      <tr>
        <%else%>
        <td width="19%" height="35" align="center" valign="middle" class=001><font color="#000000">
          <% page_start=(pagecount-1)*rs.pagesize
                if pagecount=1 then page_start=1
          page_end=rs.pagesize*pagecount
          if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if%>
          共有[<font color="#ff0000"><%=rs.recordcount%></font>]信息</font></td>
        <td width="58%" height="30" align="center" class="fy"><font color="#000000">
              <%
        if pagecount>5 and pagecount< rs.PageCount-5 and rs.pagecount>10 then
        qizu=pagecount-4
        min=pagecount+5
        response.write"<a href="&source&"?page=1&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&">
    <font color='0000BE'>首頁</font></a>&nbsp;"
        response.write"<a href="&source&"?page="+cstr(pagecount-1)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&">
    <font color='0000BE'>上一頁</font></a>&nbsp;"
        for ipage=qizu to min
                 if ipage<>pagecount then
                 response.write"<a href="&source&"?page="+cstr(ipage)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&cityid="&cityid&"><font color='0000BE'>"+cstr(ipage)+"</font></a>&nbsp;"
                 else
                 response.write "<font color='#FF0000'>"&ipage&"</font> "
                 end if
        next
        response.write"<a href="&source&"?page="+cstr(pagecount+1)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&">
    <font color='0000BE'>下一頁</font></a>&nbsp;"
        response.write"<a href="&source&"?page="+cstr(rs.PageCount)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&">
    <font color='0000BE'>尾頁</font></a>"
        end if
        if rs.PageCount<11 then
        for ipage=1 to rs.PageCount
                 if ipage<>pagecount then
                 response.write"<a href="&source&"?page="+cstr(ipage)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&cityid="&cityid&"><font color='0000BE'>"+cstr(ipage)+"</font></a>&nbsp;"
                 else
                 response.write "<font color='#FF0000'>"&ipage&"</font> " 
                 end if
        next
        end if
        if pagecount < 6 and rs.PageCount>10 then
        for ipage=1 to 10
                 if ipage<>pagecount then
                 response.write"<a href="&source&"?page="+cstr(ipage)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&cityid="&cityid&"><font color='0000BE'>"+cstr(ipage)+"</font></a>&nbsp;"
                 else
                 response.write "<font color='#FF0000'>"&ipage&"</font> "      
                 end if
        next
        response.write "<a href="&source&"?page="+cstr(rs.PageCount)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&">
    <font color='0000BE'>尾頁</font></a>"
        end if
        if pagecount>rs.PageCount-6 and rs.PageCount>10 then
        response.write "<a href="&source&"?page=1&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&title="&title&"&cityid="&cityid&">
    <font color='0000BE'>首頁</font></a>&nbsp;"  
        for ipage=rs.PageCount-9 to rs.PageCount
                 if ipage<>pagecount then
                 response.write"<a href="&source&"?page="+cstr(ipage)+"&sortid="&sortid&"&typeid="&typeid&"&qylb="&qylb&"&cityid="&cityid&"><font color='0000BE'>"+cstr(ipage)+"</font></a>&nbsp;"
                 else
                 response.write "<font color='#FF0000'>"&ipage&"</font> "
                 end if
        next
        end if
                 %>
        </font></td><form name=go2to form method=Post action=<%=fy%>> 
        <td width="13%" align="center" valign="middle" class="fy">
       <input type='hidden' name='sortid' value="<%=sortid%>"><input type='hidden' name='typeid' value="<%=typeid%>"><input type='hidden' name='qylb' value="<%=qylb%>"><input type='hidden' name='title' value="<%title%>"><input type='hidden' name='cityid' value="<%=cityid%>"><font color='000064'> 轉到第<input type='text' name='page' size=2 maxLength=3>
       頁</font>                              
       </td>
        <td width="10%" align="center" valign="middle" class="fy"><input name="image" type='image' onClick=check() value='確 定' src="/Files/BeyondPic/2005-12/8/0512808482936155.jpg"></td>
        </form>
      <tr>
        <td height="20" colspan="6" valign="bottom"><font color="#000000">&nbsp; </font></td>
      </tr>
      <% end if %>
      <% end if %>
    </table>


    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備2023014753號-2
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>