You are here: DEVPPL Forum Programming ASP & ASP.NET Forum
NOTIFICATIONS
54.314
MEMBERS
15.719
TOPICS
62.396
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

IF NOT querystring

0

Loading

IF NOT querystring

Postby Kdjuiopo » Mon Aug 01, 2011 11:07 am

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.
Kdjuiopo
 
Reputation: 0
Posts: 90
Joined: Fri Jul 01, 2011 2:32 am
Highscores: 0
Arcade winning challenges: 0

IF NOT querystring - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Re: IF NOT querystring

Postby Anna Harris » Wed May 29, 2013 2:00 pm

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
^ Back to Top