Problem with paging search results correctly

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: Problem with paging search results correctly

    "CharitiesOnline" <charitiesonline@hotmail.com> wrote in message
    news:IaCqb.179$u03.28@news-binary.blueyonder.co.uk...
    > Hello,
    > I have set this script up to add paging to a search results page.
    Which on
    > the first page works fine. I calculates how many pages there should be
    > depending on the number of results returned from my search and how
    many
    > records I have set it to display per page. All great so far,
    HOWEVER.....
    >
    > When you click the next link to see the next 10 results on the next
    page, it
    > just dumps the search details and pulls up all the records in the
    table! So
    > it finds 320 matching results, and then happily pages through them 10
    > records at a time, with both the next and prev links working!
    >
    > I need to find a way of using this paging system in conjunction with
    the
    > search results, so if for example I search for "yellow" and I get 18
    > matching results with the first 10 being displayed on the first page,
    & I
    > then click next, I would like to see the last 8 results on the next
    page,
    > with the option to click 'prev' and see the previous 10 again. What
    actually
    > happens is that it shows me the first 10 matching results and says
    > displaying page 1 of 2, I click the 'next' link and it suddenly says
    showing
    > page 2 of 32 and starts listing all the records from the database
    starting
    > at record number 11 !
    >
    > Please can anyone help me fix this?
    Please don't multi-post

    Newsgroup Etiquette:
    aspfaq.com/2081


    Recordset Paging:
    aspfaq.com/2120

    HTH
    -Chris Hohmann


    Chris Hohmann Guest

  2. Similar Questions and Discussions

    1. Sending search results to a results page..with asp
      Please help.. very :confused; Ive setup 4 dynamic drop down boxes which populate themselves from my database, this all works fine..The last box...
    2. problem with querying search results
      Hello! I am having a problem running a query on a Verity search recordset. It seems that I should be able to run a Query of Query using the...
    3. recordset paging on search/results pages
      I have a standard search form that posts to a results page. I added the recordset navigation bar to the dynamic results table using DW, but when I...
    4. Removing a row in each ItemDataBound (with condition) results in a paging problem
      Hello, I'm using a datagrid. In each ItemDataBound, i have a lot of instructions and for one condition i have to hide current row. So I use...
    5. Dreamweaver MX Paging Not Working Correctly - HELP!
      Try using a search form with a METHOD of GET. Then you can request the querystring instead of the form variables. I'm not quite sure how you'd do...
  3. #2

    Default Re: Problem with paging search results correctly

    And now for an answer to your actual question... :)

    The problem is that the search criteria is not being passed along when
    you page through the recordset. You're code is looking for
    Reuqest.Form("seach"). Therefore you must either

    1. Replace your previous/next links with a form that passes the search
    criteria.

    OR

    2. Include the search criteria in the links and modify your code to
    check for both Request.Form("search") and Request.Querystring("search")


    HTH
    -Chris




    Chris Hohmann Guest

Posting Permissions

  • You may not post new threads
  • You may 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