Results 1 to 6 of 6

Thread: Page resets when refresh clicked.

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    London
    Posts
    63

    Page resets when refresh clicked.

    I have an ASP.NET framework page which display menus on the left, and a frame with pages on the right.

    The pages change depending on what menu option someone selects from the framework page.

    When a user hits the browsers refresh button, the current page on the frame is lost and resets to the default start page.

    Do you know how I can preserve the page in the frame when a user click refresh?

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Are you checking if the Page.IsPostBack?
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    London
    Posts
    63
    yes. I'm in the page load event, i'm doing my framework page setup with

    if (!Page.IsPostBack) {

    ...
    }

    But it always goes into the above code if I hit refresh. It's as if its a new page, but really it's just a refresh.

  4. #4
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    Post the code in your page load event.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    London
    Posts
    63
    I just realised that whenever you hit refresh, it reloads the page as if its a new page.

    Now I just have to figure out how to record an event just before the user hits refresh and then save that info somewhere so that when the page loads, I can change the page that is displayed in the frame back to the one it was on.

    Posting page loading code would not be helpful since it goes into many other functions to set the page up, all the code is not in the page load method (also using javascript)

  6. #6

    Thread Starter
    Member
    Join Date
    Sep 2002
    Location
    London
    Posts
    63
    I found a possible solution, which is to create a session parameter on each page containing the URL of that page.

    Then on the main framework page, when it reloads I can read that session parameter and set the frame to that page.

    Any other idea's also welcome.

Posting Permissions

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



Click Here to Expand Forum to Full Width