Problem trying to set custom records per page

D

David Aldred

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
 
S

Steven Burn

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!


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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top