why I need to click refresh button in order to see session values

Discussion in 'ASP General' started by c676228, Mar 20, 2007.

  1. c676228

    c676228 Guest

    Hi all,
    Recently, I just found out that our program behaves differently from before.

    in our asp, in order to prevent data disppearing problem in form fields,we
    use session variable to display the field values if a customer click "back"
    button on the page2.asp in the browser,(the session variables
    Session(aQuoteName(iPerson)&"TripCost") is set up in the page2.asp) i.e.
    then in the page1.asp, we use:
    <input name="<%=aQuoteName(iPerson)& "TripCost" %>" type="text" size="6"
    value="<%=Session(aQuoteName(iPerson)&"TripCost")%>">
    to display the tripcost. This works very well in the past all the time. But
    today, when I do the similar programming, whenever I click "back" button on
    page2.asp, the data on the page1.asp all disappeared and I have to click
    "refresh" button on page1.asp in order to display all the session variables.
    What's going on, does this have to have something to do with window security
    patches, I didn't have anything changed in the program or IIS configuration.
    I also test the production version, same thing happened which it never
    happend before???
    Can you shed a light on me?
    --
    Betty
    c676228, Mar 20, 2007
    #1
    1. Advertising

  2. "c676228" <> wrote in message
    news:...
    > Hi all,
    > Recently, I just found out that our program behaves differently from

    before.
    >
    > in our asp, in order to prevent data disppearing problem in form fields,we
    > use session variable to display the field values if a customer click

    "back"
    > button on the page2.asp in the browser,(the session variables
    > Session(aQuoteName(iPerson)&"TripCost") is set up in the page2.asp) i.e.
    > then in the page1.asp, we use:
    > <input name="<%=aQuoteName(iPerson)& "TripCost" %>" type="text" size="6"
    > value="<%=Session(aQuoteName(iPerson)&"TripCost")%>">
    > to display the tripcost. This works very well in the past all the time.

    But
    > today, when I do the similar programming, whenever I click "back" button

    on
    > page2.asp, the data on the page1.asp all disappeared and I have to click
    > "refresh" button on page1.asp in order to display all the session

    variables.
    > What's going on, does this have to have something to do with window

    security
    > patches, I didn't have anything changed in the program or IIS

    configuration.
    > I also test the production version, same thing happened which it never
    > happend before???
    > Can you shed a light on me?


    Are you sure it was working before? The browser is not obliged to re-fetch
    the previous page from the origin server when you hit the back button. In
    fact in my experience it rarely does.
    Anthony Jones, Mar 20, 2007
    #2
    1. Advertising

  3. Hi Betty,

    As for the behavior you mentioned, I've try testing it on my local side and
    seems haven't been able to repro the exact same symptom. Have you tried
    visiting that page from different client machine to see if you'll get the
    consistent result?

    One thing I could get is the client-browser caching, however, normally
    client cache will also display the input values from previous view. Anyway,
    you can try add the following like code snippet to disable client cache for
    your input page to see whether it can help some.


    ============================
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%
    pStr = "private, no-cache, must-revalidate"
    Response.ExpiresAbsolute = #2000-01-01#
    Response.AddHeader "pragma", "no-cache"
    Response.AddHeader "cache-control", pStr
    %>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" method="post" action="test.asp">
    <input id="Text1" name="Text1" type="text" value='<%= Session("Text1")
    %>' />
    <input id="Text2" name="Text2" type="text" value='<%= Session("Text2")
    %>' />
    <input id="Submit1" type="submit" value="submit" />

    </form>

    </body>
    </html>
    =============================

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================



    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Mar 20, 2007
    #3
  4. c676228

    c676228 Guest

    Re: why I need to click refresh button in order to see session val

    Yes, Anthony. It worked perfectly fine. The reason I am 100% sure is before
    we never used session variables to retain field values in the form and a lot
    of customers complained about and I fixed that long time ago after using
    session variables and shocked yesterday, it doesn't work that way anymore.
    --
    Betty


    "Anthony Jones" wrote:

    >
    > "c676228" <> wrote in message
    > news:...
    > > Hi all,
    > > Recently, I just found out that our program behaves differently from

    > before.
    > >
    > > in our asp, in order to prevent data disppearing problem in form fields,we
    > > use session variable to display the field values if a customer click

    > "back"
    > > button on the page2.asp in the browser,(the session variables
    > > Session(aQuoteName(iPerson)&"TripCost") is set up in the page2.asp) i.e.
    > > then in the page1.asp, we use:
    > > <input name="<%=aQuoteName(iPerson)& "TripCost" %>" type="text" size="6"
    > > value="<%=Session(aQuoteName(iPerson)&"TripCost")%>">
    > > to display the tripcost. This works very well in the past all the time.

    > But
    > > today, when I do the similar programming, whenever I click "back" button

    > on
    > > page2.asp, the data on the page1.asp all disappeared and I have to click
    > > "refresh" button on page1.asp in order to display all the session

    > variables.
    > > What's going on, does this have to have something to do with window

    > security
    > > patches, I didn't have anything changed in the program or IIS

    > configuration.
    > > I also test the production version, same thing happened which it never
    > > happend before???
    > > Can you shed a light on me?

    >
    > Are you sure it was working before? The browser is not obliged to re-fetch
    > the previous page from the origin server when you hit the back button. In
    > fact in my experience it rarely does.
    >
    >
    >
    >
    c676228, Mar 20, 2007
    #4
  5. c676228

    c676228 Guest

    Re: why I need to click refresh button in order to see session val

    Superb, Steven, your code works perfectly fine. After I cut and pasted that
    part into my page1.asp. It behaves as I expected. Can you recommand me
    several resouces(web site, book etc.) that I can refer that part of
    knowledge. Response.AddHeader...
    You are my lucky star.
    --
    Betty


    "Steven Cheng[MSFT]" wrote:

    > Hi Betty,
    >
    > As for the behavior you mentioned, I've try testing it on my local side and
    > seems haven't been able to repro the exact same symptom. Have you tried
    > visiting that page from different client machine to see if you'll get the
    > consistent result?
    >
    > One thing I could get is the client-browser caching, however, normally
    > client cache will also display the input values from previous view. Anyway,
    > you can try add the following like code snippet to disable client cache for
    > your input page to see whether it can help some.
    >
    >
    > ============================
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <%
    > pStr = "private, no-cache, must-revalidate"
    > Response.ExpiresAbsolute = #2000-01-01#
    > Response.AddHeader "pragma", "no-cache"
    > Response.AddHeader "cache-control", pStr
    > %>
    > <html xmlns="http://www.w3.org/1999/xhtml" >
    > <head>
    > <title>Untitled Page</title>
    > </head>
    > <body>
    > <form id="form1" method="post" action="test.asp">
    > <input id="Text1" name="Text1" type="text" value='<%= Session("Text1")
    > %>' />
    > <input id="Text2" name="Text2" type="text" value='<%= Session("Text2")
    > %>' />
    > <input id="Submit1" type="submit" value="submit" />
    >
    > </form>
    >
    > </body>
    > </html>
    > =============================
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    c676228, Mar 20, 2007
    #5
  6. Re: why I need to click refresh button in order to see session val

    Thanks for your reply Betty,

    I'm glad that the suggestion is of assistance. I'm not sure about any books
    on classic ASP since ASP.NET is currently popluar for web application
    dev:). For resource site, I think the FAQ site below is quite good:

    http://tutorials.aspfaq.com/

    You can find many useful suggestion for classic ASP there.

    BTW, I've also point it in your another thread "multiple image button
    submit..."

    Hope this also helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Mar 21, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    829
    Purvi T
    Oct 19, 2004
  2. Andrew Connell
    Replies:
    0
    Views:
    365
    Andrew Connell
    Nov 12, 2003
  3. Flip
    Replies:
    3
    Views:
    969
    Tony Morris
    Feb 9, 2004
  4. Amy
    Replies:
    0
    Views:
    974
  5. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,803
    Smokey Grindel
    Dec 2, 2006
Loading...

Share This Page