Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Question Unanswered: 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:


    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?

  2. #2
    Join Date
    Mar 2003
    Atlanta, GA
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts