Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    Concord, New Hampshire, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    BACK button question

    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!!

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: BACK button question

    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!

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Location
    Concord, New Hampshire, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: BACK button question

    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. ?

  4. #4
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Coppell, Texas, USA
    Posts
    168
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: BACK button question

    Try adding these to your script before any output or other Response:
    <pre> Response.Expires = -1 '// make sure page is always refreshed
    Response.AddHeader "Pragma", "No-cache" '// no really, don't cache this page
    </pre>

    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

Posting Permissions

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