| Let Users Sort Your Displayed Records ASP Script - ASP Web Pro |
|
ASP ScriptsLET USERS SORT YOUR DISPLAYED RECORDSIt's one thing to list your records in ascending or descending order on your web page, but how about letting the user sort your records the way they want? Let's say you are displaying a list of users on your page and you want to display all of the first and last names. The first thing you need to do is create a database called
MyData. Then create a table called tblUsers with these
fields: Then, start adding some names to your database. Next, you create a page called usersort.asp and copy the below code into your page:
This will display all of the users in your database in descending order by first name as the default. Then, when the user clicks on either ASC or DESC next to First Name or Last Name, they will be able to change the sort order the way they want. Enjoy!
|
|||
|
Main Menu Other Resources
Last Updated:
|
|||
|
© 1997-2008 ASP Web Pro, Inc. | Terms of Use
|