By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,828 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,828 IT Pros & Developers. It's quick & easy.

Problem trying to set custom records per page

P: n/a
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
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <bi********@btopenworld.com> wrote in message
news:cn**********@hercules.btinternet.com...
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
Jul 22 '05 #2

P: n/a
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" <bi********@btopenworld.com> wrote in message
news:cn**********@hercules.btinternet.com...
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

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.