Pages in ASP
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=15997
Printed Date: 31 March 2026 at 1:17pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Pages in ASP
Posted By: Gullanian
Subject: Pages in ASP
Date 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
|
Replies:
Posted By: Gullanian
Date Posted: 27 July 2005 at 10:44am
|
Just found out MS-SQL doesn't support the limit clause, which I think is pretty poor.
|
Posted By: Bluefrog
Date Posted: 27 July 2005 at 12:12pm
Isn't it just better to do it in ASP.NET now?
Just do a search for http://renegademinds.com/Default.aspx?tabid=65 - music slow down err... no... not that... I meant for "asp paging" or "paging ASP" or something like that...
But I still won the http://renegademinds.com/Default.aspx?tabid=65 - Best Application Using .Net Yeah for me
And yes - that was pathetic, but I'm still totally thrilled about it.
------------- http://renegademinds.com/" rel="nofollow - Renegade Minds - Guitar Software http://renegademinds.com/Default.aspx?tabid=65" rel="nofollow - Slow Down Music
|
Posted By: Gullanian
Date Posted: 27 July 2005 at 12:41pm
That's so awesome seriously
|
Posted By: theSCIENTIST
Date 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.
------------- :: http://www.mylittlehost.com/ - www.mylittlehost.com
|
Posted By: dpyers
Date Posted: 28 July 2005 at 1:48am
I think it's time the chilly amphibian got a new eggy avatar to reflect the award .
-------------
Lead me not into temptation... I know the short cut, follow me.
|
Posted By: theSCIENTIST
Date 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.
------------- :: http://www.mylittlehost.com/ - www.mylittlehost.com
|
Posted By: ljamal
Date 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.
------------- L. Jamal Walton
http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming
|
|