Paging Help

Discussion in 'C#' started by pushkar, Dec 19, 2006.

  1. #1
    Can anyone help make paging like this:
    If there are Total 23 pages then paging should be like this:
    [1]2[3]...[10][11][12]....23

    The Center Pagin portion should be random number.
    I have made simple paging style but not like this

    How can i make paging style like this.....:confused:
     
    pushkar, Dec 19, 2006 IP
  2. tgo

    tgo Peon

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you know asp its as simple as getting the total pages then determine if you need to do this.

    <%
    Dim x, nPageCount, vPage
    nPageCount = objRs.PageCount
    vPage = nPageCount
    if nPageCount > 24 then
     x = 1
      do until x = 5
       response.write "<A href='mypage.asp?page=" & x & "'>" & x & "</A>"
       x = x + 1
      loop
    response.write " ... "
     x = 1
      do until x = 5
       response.write "<A href='mypage.asp?page=" & vPage & "'>" & vPage & "</A>"
       vPage = vPage - 1
       x = x + 1
      loop
    Else
    ... regular pageing system here
    End if
    %>
    Code (markup):
    hope this helps.
     
    tgo, Dec 27, 2006 IP
  3. pushkar

    pushkar Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanx i want just check it out..
     
    pushkar, Dec 29, 2006 IP
  4. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #4
    the asp.net 2005 GridView is a godsend regarding paging through filter.

    Essentially it is all setup so you can pass in the datasource, and it is easily configured to page, sort, and filter :)
     
    ccoonen, Dec 29, 2006 IP