473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Problem trying to set custom records per page

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
2 1162
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex | last post by:
I created a page to show RealEstate Data with images retrived from the MSSQL 2000. I am using a DataGrid control: <asp:datagrid AllowPaging="True" OnPageIndexChanged="Pageindexchanged" > ...
4
by: Mark Hanley | last post by:
I have found similar problems to mine on this and other newsgroups but I still haven't been able to solve my problem... I have two tables 'Pupil' and 'SEN' which are related on a field called...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
5
by: Shelly | last post by:
hi, I am trying to create a custom HTTP header and trying to access that variable on another ASP.NET webpage. Following is the code base- I use the following code to set the header...
2
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
3
by: Mr Newbie | last post by:
I'm testing error handling configurations and having some trouble. I created a WebForm called. ErrDefault.aspx and I am trying to use the Page error attribute to force the redirection to a custom...
2
by: Wayne | last post by:
This is a copy of a message I previously posted in a Microsoft Access Newsgroup, but it was suggested to me that my problem is ASP related and not Access, and hence I'm posting in this newsgroup now...
0
by: Walter | last post by:
Hi, can someone please help me with my custom control viewstate problem....I haven't slept for hours trying to get this fixed. I am making two custom controls which will be included on a single...
1
by: mister-Ed | last post by:
I'm trying to check for "No Records Found" in a repeater list control, but my 'numrows' variable cannot be seen by the function CheckNoR , even tho it's public (?) . I've been informed that the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.