Problem trying to set custom records per page

Discussion in 'ASP General' started by David Aldred, Nov 20, 2004.

  1. David Aldred

    David Aldred Guest

    Hi, I got a script from a site to page results from a db. That all went fine. But I wanted to let the user decide how many per page are viewed.

    Initially, the number of results per page was set by

    const PAGE_SIZE = 5

    so, I changed that to

    Dim Page_size
    Dim pagesz

    Set pagesz = 5


    Then, in the 'next page' link, referenced that so it would pass it over to the next page.
    Then I put in a small form named Resultspp, and directed back at itself.

    I added

    Dim Resultspp

    Set Resultspp = Request.Form("Resultspp")

    Then used this...

    'Check if anything was submitted on the form
    IF Resultspp = " " THEN

    'If it's empty, see if anything was submitted via the 'next page' link
    If Request.QueryString("Resultspp") = " " THEN

    'If That's empty too, set Page_Size to pagesz, which is 5
    Set Page_Size = "'pagesz'"

    'If, however, there was data in the querystring, use that
    Else
    Set Page_Size = Request.QueryString("Resultspp")
    End If
    'But, if there was data sent in the form -- use that
    Else
    Set Page_Size = Resultspp
    End If

    Any help of this would be gratefully recieved!

    regards
    David Aldred
     
    David Aldred, Nov 20, 2004
    #1
    1. Advertising

  2. David Aldred

    Steven Burn Guest

    Dim valPageSize
    valPageSize = trim(Request.Querystring("strshow"))
    if valPageSize = "" Then valPageSize = 5

    --

    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!


    "David Aldred" <> wrote in message
    news:cnodro$n1d$...
    Hi, I got a script from a site to page results from a db. That all went
    fine. But I wanted to let the user decide how many per page are viewed.

    Initially, the number of results per page was set by

    const PAGE_SIZE = 5

    so, I changed that to

    Dim Page_size
    Dim pagesz

    Set pagesz = 5


    Then, in the 'next page' link, referenced that so it would pass it over to
    the next page.
    Then I put in a small form named Resultspp, and directed back at itself.

    I added

    Dim Resultspp

    Set Resultspp = Request.Form("Resultspp")

    Then used this...

    'Check if anything was submitted on the form
    IF Resultspp = " " THEN

    'If it's empty, see if anything was submitted via the 'next page' link
    If Request.QueryString("Resultspp") = " " THEN

    'If That's empty too, set Page_Size to pagesz, which is 5
    Set Page_Size = "'pagesz'"

    'If, however, there was data in the querystring, use that
    Else
    Set Page_Size = Request.QueryString("Resultspp")
    End If
    'But, if there was data sent in the form -- use that
    Else
    Set Page_Size = Resultspp
    End If

    Any help of this would be gratefully recieved!

    regards
    David Aldred
     
    Steven Burn, Nov 21, 2004
    #2
    1. Advertising

  3. David Aldred

    David Aldred Guest

    thanks, that was a great help.

    > Dim valPageSize
    > valPageSize = trim(Request.Querystring("strshow"))
    > if valPageSize = "" Then valPageSize = 5
    >
    > --
    >
    > Regards
    >
    > Steven Burn
    > Ur I.T. Mate Group
    > www.it-mate.co.uk
    >
    > Keeping it FREE!
    >
    >
    > "David Aldred" <> wrote in message
    > news:cnodro$n1d$...
    > Hi, I got a script from a site to page results from a db. That all went
    > fine. But I wanted to let the user decide how many per page are viewed.
    >
    > Initially, the number of results per page was set by
    >
    > const PAGE_SIZE = 5
    >
    > so, I changed that to
    >
    > Dim Page_size
    > Dim pagesz
    >
    > Set pagesz = 5
    >
    >
    > Then, in the 'next page' link, referenced that so it would pass it over to
    > the next page.
    > Then I put in a small form named Resultspp, and directed back at itself.
    >
    > I added
    >
    > Dim Resultspp
    >
    > Set Resultspp = Request.Form("Resultspp")
    >
    > Then used this...
    >
    > 'Check if anything was submitted on the form
    > IF Resultspp = " " THEN
    >
    > 'If it's empty, see if anything was submitted via the 'next page' link
    > If Request.QueryString("Resultspp") = " " THEN
    >
    > 'If That's empty too, set Page_Size to pagesz, which is 5
    > Set Page_Size = "'pagesz'"
    >
    > 'If, however, there was data in the querystring, use that
    > Else
    > Set Page_Size = Request.QueryString("Resultspp")
    > End If
    > 'But, if there was data sent in the form -- use that
    > Else
    > Set Page_Size = Resultspp
    > End If
    >
    > Any help of this would be gratefully recieved!
    >
    > regards
    > David Aldred
    >
    >
     
    David Aldred, Nov 22, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Dvali

    Records per page in CrystalReport

    David Dvali, Aug 26, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    448
    David Dvali
    Aug 26, 2005
  2. =?Utf-8?B?S01aX3N0YXRl?=

    Quick one - Is SESSION per browser instance or per IP Address?

    =?Utf-8?B?S01aX3N0YXRl?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    5,949
    gerry
    Apr 10, 2006
  3. Razvan
    Replies:
    1
    Views:
    443
    tony vee
    Sep 10, 2004
  4. Replies:
    5
    Views:
    2,636
  5. chris brat
    Replies:
    1
    Views:
    672
    chris brat
    May 10, 2006
Loading...

Share This Page