D
darrel
I have a userControl that displays a repeaterControl to display data. I have
this set up so that it pages, 10 records per page.
This works fine.
Now, for some of the data, it'd be nice if the end-user could jump to the
page alphabetically.
For instance, their may be 80 pages with 10 biographies each. Instead of the
end user clicking NEXT, NEXT, NEXT until he finds the bio he's looking for
(let's say Smith, Bob) I'd like for them to be able to click on "s" and jump
to the particular page where the S's begin.
Any thoughts on how to do this? Off the top of my head, this is what I'm
thinking:
- Grab all records (last name)
- trim field to first letter
- Parse all of these to grab only unique letters
- Attach that to an array
- Step through the array to write out each letter navigation
- upon click of 's', query database to grab all records (last name) sorted
by last name
- count through the records to get to the first record beginning with 's'/
- divide by 10
- redirect to the 10th 'page' of the record set.
But that seems tedious. Is there a better/more streamlined way?
-Darrel
this set up so that it pages, 10 records per page.
This works fine.
Now, for some of the data, it'd be nice if the end-user could jump to the
page alphabetically.
For instance, their may be 80 pages with 10 biographies each. Instead of the
end user clicking NEXT, NEXT, NEXT until he finds the bio he's looking for
(let's say Smith, Bob) I'd like for them to be able to click on "s" and jump
to the particular page where the S's begin.
Any thoughts on how to do this? Off the top of my head, this is what I'm
thinking:
- Grab all records (last name)
- trim field to first letter
- Parse all of these to grab only unique letters
- Attach that to an array
- Step through the array to write out each letter navigation
- upon click of 's', query database to grab all records (last name) sorted
by last name
- count through the records to get to the first record beginning with 's'/
- divide by 10
- redirect to the 10th 'page' of the record set.
But that seems tedious. Is there a better/more streamlined way?
-Darrel