newsgroups-index (beta)

Current group: comp.programming

Anyone knows ASP?

Anyone knows ASP?  
smiyos
 Re: Anyone knows ASP?  
smiyos
 Re: Anyone knows ASP?  
Programmer Dude
From:smiyos
Subject:Anyone knows ASP?
Date:21 Jan 2005 10:23:28 -0800


any help would be great... :)


Thanks
Hello,


Im trying to sort my columns ascending/descending by clicking on the
column title. I understand how to do only asc or only desc, but i cant
figure out how to do both.

I know i need to flip the links (meaning if roll over "first name", it
will show something like "bottom bar of the window and after i cilck on "first name" to sort the
first name column in asc order, while it is in ascending order, when i
roll my mouse over "first name" again, the bottom of the bar will show
a link something like "
link in the address bar will show "

The way i sorted asc or desc Only was:


If Request.QueryString("Order") = "FNameDESC" Then
strSQL = strSQL & " ORDER BY FName"


....code.......




FIRST NAME

From:smiyos
Subject:Re: Anyone knows ASP?
Date:21 Jan 2005 12:30:57 -0800
Thanks for the quick response! :)
ill try to approach it by using to values. ;)
From:Programmer Dude
Subject:Re: Anyone knows ASP?
Date:Fri, 21 Jan 2005 13:30:25 -0600
smiyos writes:

> I know i need to flip the links (meaning if roll over "first name", it
> will show something like "> bottom bar of the window and after i cilck on "first name" to sort the
> first name column in asc order, while it is in ascending order, when i
> roll my mouse over "first name" again, the bottom of the bar will show
> a link something like "
> link in the address bar will show "
Do you understand why that is, or are you also asking about that?
(It's showing the link that GOT you to the current page and won't change
until you click a column header or other link.)

> The way i sorted asc or desc Only was:
>
>
> If Request.QueryString("Order") = "FNameDESC" Then
> strSQL = strSQL & " ORDER BY FName"

I don't have time to write any code for you, but I'll tell you how I
have approached similar situations.

Parse your input to derive two values: the columm name for sorting
and whether the sort is ASC or DESC. Then just append them to your
SQL:

strSQL = strSQL & " ORDER BY " & FieldName & " " & SortOrder

Then, when you build the page, use the SortOrder variable to determine
which (the opposite!) sort order to put in the link for the column
whose name matches FieldName. Leave other columns "as is".
   

Copyright © 2006 newsgroups-index   -   All rights reserved   -   Impressum