How to Handle Many Page Links in a Search?

V

VUNETdotUS

Search results on my site started to show a large number of page
links. I never had to deal with it before but it is time now. I am
trying to come up with a good logic / idea how to display a large
number of page links without showing all of them at once.
For example, if user is searching for "pets" and gets 50 pages back, I
want to show 10-20 page links and hide the rest. Also, the closer user
gets to the last visible pages, the more hidden page links become
visible. Something like Google does...
If somebody worked with it before, could you share with ideas, or
suggestions, or good examples to look at? Is there a standard way to
implement this, perhaps?
Thanks.
 
B

Bob Barrows [MVP]

VUNETdotUS said:
Search results on my site started to show a large number of page
links. I never had to deal with it before but it is time now. I am
trying to come up with a good logic / idea how to display a large
number of page links without showing all of them at once.
For example, if user is searching for "pets" and gets 50 pages back, I
want to show 10-20 page links and hide the rest. Also, the closer user
gets to the last visible pages, the more hidden page links become
visible. Something like Google does...
If somebody worked with it before, could you share with ideas, or
suggestions, or good examples to look at? Is there a standard way to
implement this, perhaps?
Thanks.
Does this help?
http://www.aspfaq.com/show.asp?id=2120
 
V

VUNETdotUS

Does this help?http://www.aspfaq.com/show.asp?id=2120
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

I am not sure where exactly is the code sample on that page. I think
it shows paging only, not hidden page links...
Thanks.
 
B

Bob Barrows [MVP]

VUNETdotUS said:
I am not sure where exactly is the code sample on that page. I think
it shows paging only, not hidden page links...
Thanks.
"hidden"??

Oh! You want to send ALL the links to the client and hide/unhide them in
response to user actions? You should post this to a client-side
scripting group - it has nothing to do with asp. Try
microsoft.public.scripting.jscript
 
V

VUNETdotUS

"hidden"??

Oh! You want to send ALL the links to the client and hide/unhide them in
response to user actions? You should post this to a client-side
scripting group - it has nothing to do with asp. Try
microsoft.public.scripting.jscript
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

"Hidden" may not be a correct word. I thought it is better to do it on
aserver side with ASP since it handles my paging.
Simply, if you look at Google, searching the word "ASP", hit 50th page
and you'll find that it shows the range of pages from 40 to 60,
leaving 50th page in the middle.
That's kind of what I need.
Thanks
 
B

Bob Barrows [MVP]

VUNETdotUS said:
"Hidden" may not be a correct word. I thought it is better to do it on
aserver side with ASP since it handles my paging.
Simply, if you look at Google, searching the word "ASP", hit 50th page
and you'll find that it shows the range of pages from 40 to 60,
leaving 50th page in the middle.
That's kind of what I need.
Thanks

You've got a list of links, right? So you only want to send a subset
(page) of those links to Response with each Request, right? So, the
first step is to decide how you are going to store that list of links
between page requests: database, text file, session variable ...
The links also need a sortable ID so they can be grouped into pages.
Then you need to create a mechanism to allow the user to select which
page of links he wants to see. Perhaps a series of links with the start
# of the page included in the querystring the way Google does it.
Then you need to write the serverside code to read the start # from the
querystring, extract the corresponding page from the stored list of
links and write it to Request.
As Jon says, there's zillions of examples of doing this available via
Google.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,160
Latest member
CollinStri
Top