Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Pages in ASP
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Pages in ASP

 Post Reply Post Reply
Author
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Topic: Pages in ASP
    Posted: 27 July 2005 at 10:37am
Hi all

In ASP what's the best way to do pages, for example in a forum?  Sort of like, page 2, 3, 4.

When you click on a page is needs to select a range of records, any easier way of doing this than the method I am doing?  I select the upper record, so if its 10 on each page, on page 3, i select 30, and loop through until I hit 20 before displaying.  Is there anyway to select a range of records?  The mroe pages there are, the longer each one takes to load.

So sort of like:

SELECT RECORDS 10 to 20 FROM tblReplies WHERE topicID = 33


Edited by Gullanian - 27 July 2005 at 10:38am
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2005 at 10:44am
Just found out MS-SQL doesn't support the limit clause, which I think is pretty poor.
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2005 at 12:12pm
Isn't it just better to do it in ASP.NET now? Wink 

Just do a search for music slow down err... no... not that... I meant for "asp paging" or "paging ASP" or something like that...

But I still won the Best Application Using .Net Big smile Yeah for me

And yes - that was pathetic, but I'm still totally thrilled about it.


Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2005 at 12:41pm
That's so awesome seriously Big smile
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2005 at 12:55am
As Bluefrog mentioned, it's always best to do whatever in .NET, but if you are like me, still very much tied to classic ASP, classic ADO provides methods for paging, check this:

http://www.asp101.com/articles/recordsetpaging/index.asp

You find many more if you google for [ASP paging].

By the way, congrats froggy on your award, well done.

Edited by theSCIENTIST - 28 July 2005 at 12:57am
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2005 at 1:48am
I think it's time the chilly amphibian got a new eggy avatar to reflect the award Clap.

Edited by dpyers - 28 July 2005 at 1:48am

Lead me not into temptation... I know the short cut, follow me.
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2005 at 3:57pm
He got one already, but there's no blue frog.

What about something like this:


It's very difficult to design for such low resolution as 64x64, but I think it would suit you ok. Design based on this frog that I painfully cut:


If you want it, I can send you the full-res PSDs.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2005 at 2:22pm
The best way to do this is using a stored procedure.

to get the total number of records do
select count(Id) from table

then create a temp table with autonumber field
then insert all records the temp table
select the ID range you need from the temp table
select * from temptable where ID>x and ID<y

then delete the temp table

this may seem like a lot of work, but because it's SQL side it runs much faster then returning all the records and doing the work with ADO.

Do a search at www.sqlteam.com of paging for a clear example.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.