SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Request.QueryString returns weird results

    I'm working on a page that uses a querystring to decide what to show on the page. The first and second time the page is run, it works fine, but on the third time and subsequent there afters, no matter what is in the querystring, it comes in as the first result.

    When I use a response to see what value is being returned in the querystring, the value of the first time the page is run shows, not the current value.

    I've tried preventing the page from being cached, but that doesn't help.

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there's not enough information here for an answer. people can only guess what might be going wrong.

    if we can't reproduce the problem we can't offer a specific solution.

    --check your browser settings
    -- show us some test code
    --create a simple test page to debug the problem

    Code ASP:
    <%
    dim check_value
    check_value = request.querystring("p")
    response.write "check_value from qs = " & check_value & "<br>"
    %>
     
    <a href="thispage.asp?p="<%=check_value+1%>" >link</a>

  3. #3
    SitePoint Member
    Join Date
    Dec 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code is pretty basic.
    Code ASP:
    <%
    Dim SomeVariable
    SomeVariable = Request.QueryString("x")
    %>

    Say that the first time the page is run, x in the URL is set as 123, the second time, x is set as 234, and the third time x is set as 345.

    In the code, response.querystring returns the first time that x is 123, the second time x is 234, and the third time and all times thereafter x is 123.

    Does this clear things up for you?

  4. #4
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if that sample code fails then obviously it's not an ASP coding problem.

    There's something else going on and we can't help as there is not enough information.

    The repetition of failing on the third pass is the only clue and clearly makes no sense.


Tags for this Thread

Bookmarks

Posting Permissions

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