Monday, August 16, 2010

Asp.net question....sorting question with a label?

I have a page with an sqldatasource and a gridview that lets me sort from four different columns. i'm supposed to have a label below that that shows ';Sorted by.....XXX'; XXX being whatever sort is chosen.





How do I make the label change depending on the sort?Asp.net question....sorting question with a label?
is it a label or a literal? i thought you could only work with literals in asp.net. set a simple variable like


int sort = 0;


0 is low price


1 is sorted with highest price first


2 is popularity etc. and then a bunch of if statements like


if (sort == 0)thisLiteral.Text=';Lowest Price';;

No comments:

Post a Comment