• BACK button question

    Author
    Topic
    #382846

    This is my first ASP project…it displays a search page that users can select their search criteria and select the number of records to display on a page. The problem is on the second page. If I use the back button after looking at one or more pages, the data on the page changes, but the page number in the list box doesn’t change. If I hit the REFRESH button the page number changes. Is there a way to make the page number change without hitting the REFRESH button?
    Thanks in advance!!

    Viewing 1 reply thread
    Author
    Replies
    • #650570

      Using the Back button with web applications is a typical problem. As you know, the Back button reads a cached copy of the page rather than re-requesting the page from the Server. The server has no control over the content under those circumstances.

      So, I think my answer to your question is no. You can’t invoke a server-side process just from having a user click the “Back” button. (However, there is probably a way to have a JavaScript function re-request the page after the user clicks “Back”.)

      Hope this helps!

      • #650853

        Thanks Mark, it does help. But now I have another question! How to capture the click event of the back button, I haven’t worked with javascript. ?

    • #652004

      Try adding these to your script before any output or other Response:

        Response.Expires = -1                   '// make sure page is always refreshed
        Response.AddHeader "Pragma", "No-cache" '// no really, don't cache this page
      

      This is not sure-fire, but it helps. You’d think one or the other would do, but no… The problem is whether or not the browser is following instructions. IE seems to use the cache to often, while Netscape (IMHO) doesn’t use it enough.

      HTH

    Viewing 1 reply thread
    Reply To: BACK button question

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: