ASP 101 - Active Server Pages 101 - Web03
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash





Script Output:
id (+ / -) last_name (+ / -) first_name (+ / -) sales (+ / -)
27 White Mark 4500
26 Xavier Simon 5580
25 Underwood Debra 3790
24 Valentino Linda 2965
23 Zimmerman Walter 4980
22 Youngs Quincy 4420
21 Ingraham Owen 4750
20 Smith Fred 6370
19 Quinn Howard 5865
18 Ostrander Ian 3965
17 Thompson Vincent 4820
16 Graham Chris 4050
15 Hopkins Peter 6710
14 Nelson Beth 4345
13 Dodsworth Nancy 2750
12 Steel Tammy 3570
11 Miller Greg 5640
10 Callahan Laura 3675
9 Jones Edward 3450
8 Richards Kate 4260
7 Edwards Frank 3840
6 Andersen David 6420
5 King Robert 5290
4 Peacock Margaret 4685
3 Buchanan Steven 3245
2 Leverling Janet 6250
1 Fuller Andrew 5000

ASP HTML Download            FAQ

ASP.NET Version

This piece of sample code allows users to sort data from a database by simply clicking on the heading of the field they would like to sort by. It's relatively simple to implement and can make finding that certain database record much easier.

The code is pretty straightforward. Give it a look...

Alternate Version: Simpler Looking Header with Arrows

One of our readers recently sent me an email with some ideas to improve our database sort sample above. Here's a excerpt from that email:

Rather than have two links, '+' and '-', you can remember the current state in a variable and simply toggle between the two by clicking the field name itself. Or, as I've done here, provide feedback as to the order by using arrows.

The code that was sent worked fine, but was a little complex and was obviously taken from a highly modified version of the code. I've simplified things a bit and incorporated both suggestions: the simpler UI (just clicking on the field name) and the indicator arrows.

Database Sort (with Arrows)


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers