Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Problem trying to set custom records per page

Reply
Thread Tools

Problem trying to set custom records per page

 
 
David Aldred
Guest
Posts: n/a
 
      11-20-2004
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
 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      11-21-2004
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" <(E-Mail Removed)> wrote in message
news:cnodro$n1d$(E-Mail Removed)...
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


 
Reply With Quote
 
 
 
 
David Aldred
Guest
Posts: n/a
 
      11-22-2004
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" <(E-Mail Removed)> wrote in message
> news:cnodro$n1d$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple query returns 0 records in asp, but all records in vbscript masg0013@gmail.com ASP General 3 11-02-2006 09:23 AM
Custom Taglib problems - instead of a single instance per page, I have a single instance per application. chris brat Java 1 05-10-2006 11:16 AM
Records per page in CrystalReport David Dvali ASP .Net 0 08-26-2005 08:50 PM
Delete records or update records Dan ASP General 1 05-10-2004 01:25 PM
match muliple header records to associated detail records Luke Airig XML 0 12-31-2003 12:06 AM



Advertisments