Determine to SQL Order by ASC or DSC

Mattixman

New Member
I have a datalist that receives values from a MySQL database. This datalist can be sorted by various column values such 'Title', 'Author', 'Published Date', etc. To determine what value to sort by, the value is inserted into the query string. I.e. www.web.com/default.aspx?order_by=title I also determine wheter to order in ascending order or descending order.I.e. www.web.com/default.aspx?order_by=title&direction=ascI want to be able to set the direction to asc if the (a working example of what I'm looking to do can be found at http://www.milwaukeejobs.com/jobs/c...y-Internet-Web-Development/Milwaukee,-WI/1306*Notice if you click the sort values such as by Date its set to ASC, if you click it again its set to DSC; I'd like to do this on my site * )I'm not sure how to do this. I was thinking of a \[code\]If Page.IsPostback\[/code\] condition, but clicking the url does not cause a postback. I thought about grabbing the sender object, or system.eventargs variables that are sent through the Page.Onload event, but I'm not sure if I could do anything with these. Any ideas?
 
Back
Top