1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

IE "Back" Button cache

Discussion in 'C#' started by jamescw, Jun 5, 2006.

  1. #1
    hihi../

    i have this problem. When i add contents in the defult form(index form) and clicked on the "Submit" button when ready to add contents to the databse by posting form to "add.asp". System will prompt user "Contents Added to Database" when the data was adde to the database. The system will display the lastest contents page to the user.

    However, When i clicked on the "Back" button at the lastest contents page, it retuen to the add.asp asp page and prompt a msg box that the contents was added. i suppose the stale data was not disposed.

    How can it be done when i clicked on the "Back" button on the last page, it will show the previous page?

    jamescw
    ???
     
    jamescw, Jun 5, 2006 IP
  2. DangerMouse

    DangerMouse Peon

    Messages:
    275
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi, adding this code at the top of your page should help you with this problem...

    <%
    Response.Expires=-1
    %>

    That, or you could disable the back button using javascript

    Add this into the body tag of the page you don't want users to return too...
    <body onLoad="history.go(+1)">

    Good luck!
     
    DangerMouse, Jun 6, 2006 IP
  3. edr

    edr Guest

    Messages:
    784
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sometimes the ASP headers are not enough. If adding the response.expires does not clear your problem you can also use the html meta no-cache instructions in conjunction. Sometimes it is the borwser itself that will carry the cache and not just the server.
     
    edr, Jun 10, 2006 IP