If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Can you set a default QueryString?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-06-04, 22:19
vision69 vision69 is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
Question Can you set a default QueryString?

I have taken over some code that uses a querystring request as the basis of all fuctions in the application.

Something like this:

Request.QueryString("content")

appears all over the application. If the value is not defined, the programmer does a redirect to the page and passes a default value back to itself.

I would like to remove this step, and simply add the content variable to the querystring object. Is there any way I can insert a variable so that further down in the application code it can be used?
Reply With Quote
  #2 (permalink)  
Old 01-07-04, 15:39
MrWizard MrWizard is offline
Registered User
 
Join Date: Mar 2003
Location: Atlanta, GA
Posts: 191
One way would be to load a default value into an Application or Session variable. Then, check the querystring value and assign it if it has something in it.

In your global.asa file, or on the first called page of your application...

Application("qs")="querystringvalue" (or, use Session("qs") if you like)
this value is then available from any subsequent page.

Then, on your pages....

qs= Request.QueryString("content")
If qs="" then qs=Application(qs)

At this point, qs= the passed querystring content if there was one, or else it = the default value if not.

Tim
__________________
Tim
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On