dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: Reloading a page via a Back button

  1. #1
    Join Date
    Aug 2005
    Location
    USA
    Posts
    116

    Reloading a page via a Back button

    Is there a way in ASP to make a page reload either through the broswers back button or a forms?

  2. #2
    Join Date
    Jun 2006
    Posts
    18
    What you want to do is make the page non-cacheable so the page is always reloaded.

    Add this to the top of your webpage:

    <% Response.CacheControl = "no-cache" %>
    <% Response.AddHeader "Pragma", "no-cache" %>
    <% Response.Expires = -1 %>

    Regards

  3. #3
    Join Date
    Aug 2005
    Location
    USA
    Posts
    116
    Thanks alot, that did the trick. You guys rock here.

  4. #4
    Join Date
    Jun 2006
    Posts
    18
    Welcome

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia
    Posts
    125
    Also have a look in the IIS setup, there is an headers option that globally sets this.

    Look under properties --> http headers --> Tick enable content headers --> Set Expire immediately

  6. #6
    Join Date
    Aug 2005
    Location
    USA
    Posts
    116
    I was also wondering if some one wouldn't mind taking a look at this for me, as it is sort of stumping me.

    I'm builiding an online insurance application, where people input thier data, and it gives them rates, then lets them apply.

    Here is the url: http://67.62.217.33/test4/

    You will need to supply a valid zip, as it does a check for areas the insurance is available. You can use 23834

    The issue I'm having is on the the next page there, intro-page2.asp, if you fill in your information or select add a child and then submit that, it takes you to the page with your quotes. No problem there. The problem is that if you use either the back button I have on the page or the browsers in IE, nothing is retained and the dropdowns disappear. But in FF, everything is fine.

    Is this a cookie issue or something security wise related to IE? IE has become a real thorn in my side on this project.

    Thanks as always for the assiatance.

  7. #7
    Join Date
    May 2006
    Location
    Sydney, Australia
    Posts
    125
    As its an ASP page it will be reloading from scratch (i am guessing)

    Saving the information in session variables and displaying them, set the sessions to blank to start with, so that even on the first load it will load them (just nothing to show).

    Then hopefully if someone clicks back it might display them for you.

    I think the problem with the back button is it behaves differently in different circumstances, and not always as we would like. I'd try and discourage the user from pressing it.

  8. #8
    Join Date
    Aug 2005
    Location
    USA
    Posts
    116
    Yeah, thanks.

    I feel much the same way, we are adding our own navigation, as I really don't want to rely on the browsers buttons. But, in my case here, thats not really the issue. The real reason I'm jumping through all these hoops is because of the dynamically created "Add Child" elements on the page.

    What's happening is, that once the page loads intially, and you submit the form, it dynamically creates the numbered Div elements, and those values are cached. So, when you press the back button and try to re-add them it doesn't work unless you reload the page, thus reseting those Div elements through JavaScript.

    I guess the irrating part for me is that in FF, even with the page reload, it will keep the session variables as you described above. But of course, IE doesn't want to play nice. I've tried to re-intialize the page(call the JS function) through several diffrent means, but thus far no luck. I've looked on here and some other websites, and I'm not really sure even if I re-wrote the JS code that it would behave as I need it to.

    But thanks for the input & suggestions. If anyone can think of another alternative solution to this, I'm all ears.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles