|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP- sorting records
i'm doing a site for a car dealership and have the inventory page in ASP. i have gotten the list to appear and i can get it to sort if i hard code the different arrangements, but i don't want so that many pages. so, what i want to do is have the basic headings be links to sort by that column (ie year, make, price, etc) and refresh the page automatically. many car sites have this, but i haven't been able to find out the code behind it. can anybody help?
|
|
#2
|
|||
|
|||
|
Hey,
You need to use remote scripting to do something like this. Checkout Annette's great article on this and you'll be up and running in no time: http://www.devarticles.com/art/1/99 |
|
#3
|
|||
|
|||
|
Could you do it with cases? Say you have a cars.asp, which among other things says
Dim strSort strsort = Request.QueryString("sort") strSQL = "Select * from Cars (or whatever your table is)" And you have your select cases - it takes the SQL statement from these cases and adds it on to the original statement as appropriate: Select Case strSort Case Year strSQL = strSQL & "Order by year DESC" Case Price strSQL = strSQL & "Order by price DESC" etc End Select and then have the year column <a href="cars.asp?sort=year">Year</a> and the price column <a href="cars.asp?sort=price">Price</a> etc Or is this too much coding? Last edited by aspnewbie : August 8th, 2002 at 10:46 PM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > ASP- sorting records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|