| Author |
Topic Search Topic Options
|
Gullanian
Senior Member
Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
|
Post Options
Thanks(0)
Quote Reply
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
|
 |
Gullanian
Senior Member
Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
|
Post Options
Thanks(0)
Quote Reply
Posted: 27 July 2005 at 10:44am |
|
Just found out MS-SQL doesn't support the limit clause, which I think is pretty poor.
|
 |
Bluefrog
Senior Member
Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
|
Post Options
Thanks(0)
Quote Reply
Posted: 27 July 2005 at 12:12pm |
Isn't it just better to do it in ASP.NET now?
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  Yeah for me
And yes - that was pathetic, but I'm still totally thrilled about it.
|
|
|
 |
Gullanian
Senior Member
Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
|
Post Options
Thanks(0)
Quote Reply
Posted: 27 July 2005 at 12:41pm |
That's so awesome seriously
|
 |
theSCIENTIST
Senior Member
Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
|
Post Options
Thanks(0)
Quote Reply
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
|
|
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 July 2005 at 1:48am |
I think it's time the chilly amphibian got a new eggy avatar to reflect the award  .
Edited by dpyers - 28 July 2005 at 1:48am
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
theSCIENTIST
Senior Member
Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |