Professional Web Applications Themes

DBPaging with modified page navigation - ASP Database

Hi! I use DB Paging from asp101 (http://www.asp101.com/samples/viewasp.asp?file=db%5Fpaging%2Easp) and works properly. I want to modify the page navigation because if I have 4000+ records and I want to view 20 records per page, meaning to say, it will write page 1 to 200 beneath the page. I have seen some page that they control it by 10 after 10 there is a link that will change page navigation to 11-20. Can you help me do this? Me...

  1. #1

    Default DBPaging with modified page navigation

    Hi!

    I use DB Paging from asp101
    (http://www.asp101.com/samples/viewasp.asp?file=db%5Fpaging%2Easp) and works
    properly. I want to modify the page navigation because if I have 4000+
    records and I want to view 20 records per page, meaning to say, it will
    write page 1 to 200 beneath the page. I have seen some page that they
    control it by 10 after 10 there is a link that will change page navigation
    to 11-20. Can you help me do this?

    Me


    A Guest

  2. #2

    Default Re: DBPaging with modified page navigation

    Sub writeIndex()

    if rs.PageCount = 0 then exit sub

    if intPage = 0 then intPage = 1

    if rs.PageCount <= 15 then
    fPg=1
    lPg=rs.PageCount
    else
    if intPage =<8 then
    fPg=1
    lPg=15
    else
    fPg=intPage-7
    lPg=intPage+7
    end if
    end if

    if fPg =< 1 then fPg=1
    if lPg >= rs.PageCount then lPg=rs.PageCount
    if fPg > 1 then ldots="..." else ldots=""
    if lPg < rs.PageCount then rdots="..." else rdots=""

    Response.Write "<table style=""font-size:9pt""><tr align=""center"">"
    if intPage > 1 then
    Response.Write "<td>|<a href=" & chr(34) & "amr.asp?" & newQstr & "pg=1" &
    chr(34) & " title='" & vFirst & "' target='_self'><<</a>&nbsp;&nbsp;</td>"

    Response.Write "<td><a href=" & chr(34) & "amr.asp?" & newQstr & "pg=" &
    (intPage-1) & chr(34) & " title='" & vPrevious & "'
    target=""_self""><<</a>&nbsp;&nbsp;</td>"

    Response.Write "<td><b>" & vPage & "</b>&nbsp;" & ldots & "&nbsp;</td>"
    else
    Response.Write "<td>|<<&nbsp;&nbsp;<<&nbsp;&nbsp;<b>" & vPage &
    "</b>&nbsp;&nbsp;</td>"
    End If

    for i= fPg to lPg
    if i = intPage then
    Response.Write "<td><b>" & i & "<b></td>"
    else
    Response.Write "<td><a target =""_self"" href=" & chr(34) & "amr.asp?" &
    newQstr & "pg=" & i & chr(34) & " Title='" & vPage & i & "'>" & i &
    "</a>,</td>"
    End If
    Next
    if intPage < rs.PageCount then
    Response.Write "<td>&nbsp;" & rdots & "&nbsp;<b>" & vOf & " " &
    RS.PageCount & "</b>&nbsp;" & vPages & "&nbsp;<a href=amr.asp?" & newQstr &
    "pg=" & (intPage+1) & " title='" & vNext & "' target='_self'>>></a></td>"
    Response.Write "<td>&nbsp;&nbsp;<a href=amr.asp?" & newQstr & "pg=" &
    RS.PageCount & " title='" & vLast & "' target='_self'>>></a>| </td>"
    else
    Response.Write "<td>&nbsp;&nbsp;of " & RS.PageCount & " " & vPages &
    "&nbsp;&nbsp;>>&nbsp;&nbsp;>>|</td>"
    End If
    Response.Write "</tr>"
    Response.Write "</table>"

    End Sub

    %>


    John Guest

  3. #3

    Default Re: DBPaging with modified page navigation

    Read through http://www.aspfaq.com/2120 ... plenty of alternative
    approaches, all of which you can easily change to 10, 30, 70 items per page,
    etc.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "A P" <ph> wrote in message
    news:phx.gbl... 
    works 


    Aaron Guest

Similar Threads

  1. Page Navigation Help
    By gendrall in forum Coldfusion - Advanced Techniques
    Replies: 6
    Last Post: March 14th, 08:24 PM
  2. Getting last modified date from remote web page
    By BOBCAMPBELL in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: March 5th, 06:03 PM
  3. Page Navigation?
    By LL in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: February 4th, 09:39 PM
  4. Best way to make navigation bar on each page?
    By Juan in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 11th, 02:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139