The downside of my celebrity is that I cannot go anywhere in the world without being recognized. It is not enough for me to wear dark sunglasses and a wig. The wheelchair gives me away.
Hi Richard Do you have any techniques/tutorials on paging techniques? I have a list of entries for a blog and don't want them all showing up. Obviously I could filter the queries with a TOP # to only show a couple but then I would like the '1 2 3 Last' at the bottom. Would it be best using the record count and then dividing by the Top # for the number I would need? Just gotta keep a check on what page I am on, to change what shows up along the bottom. I see you use the either the MaxDate or ID/LastComment for the Forum/Blog. Regards Alex
Reply from Richard Rost:
What I do is set the number of items I want on a page in a variable, let's say 20. Then I loop with a counter through 20 items. Now, grab the ID of the LAST item displayed (which you can do in your loop) and then have a "NEXT >" link at the bottom which will reload the page but edit your SQL to start at the LAST item. You can send it as a querystring:
ListCustomers.asp?ID=1234
You can then read this into the page with Request("ID") and then adjust your SQL accordingly:
MySQL = "SELECT * FROM CustomerT WHERE ID >" & ID
The same concept would work with a PREVIOUS link as well. Yes, there are advanced "paging" techniques for ASP, but I find this works just as good if not better.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages Forum.