| You are here: DEVPPL ‹ Forum ‹ Programming ‹ ASP & ASP.NET Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
IF NOT querystring
2 posts
• Page 1 of 1
0
IF NOT querystring
I have a question on using querystrings. Is there some way to set a default value that is used when NO querystring is added to the URL?
I have a page that displays product information in a table form. I decided to make an option for the user to sort the data, so I created a variable which changes the SORT clause in the SQL statement. The variable is controlled using a querystring. So for example, "products.asp?sort=price" would sort products by price instead of model. This part works fine.
Here's where I need some help... When I initially load the page, I do not want the querystring added to the URL. I basically want to just load "products.asp" and have a default sort order. I assume I need something like "if not querystring", but I don't know if it's possible to use the presence of a querystring as an IF condition.
I'm looking for some suggestions. Any help is appreciated.
I have a page that displays product information in a table form. I decided to make an option for the user to sort the data, so I created a variable which changes the SORT clause in the SQL statement. The variable is controlled using a querystring. So for example, "products.asp?sort=price" would sort products by price instead of model. This part works fine.
Here's where I need some help... When I initially load the page, I do not want the querystring added to the URL. I basically want to just load "products.asp" and have a default sort order. I assume I need something like "if not querystring", but I don't know if it's possible to use the presence of a querystring as an IF condition.
I'm looking for some suggestions. Any help is appreciated.
- Kdjuiopo
- Reputation: 0
- Posts: 90
- Joined: Fri Jul 01, 2011 2:32 am
- Highscores: 0
- Arcade winning challenges: 0
0
Re: IF NOT querystring
You can provide some initial value or default value when there is no querystring attached to the URL.
- Anna Harris
- Reputation: 0
- Posts: 17
- Joined: Wed May 15, 2013 6:43 am
- Highscores: 0
- Arcade winning challenges: 0
|
|