How to stop a page from reloading

Discussion in 'ASP .Net' started by bthumber, May 14, 2009.

  1. bthumber

    bthumber Guest

    In my application when a user comes to the last page his information is
    inserted in the database. If the user navigates away from the page, no
    problem. If the user navigates back to the final page it causes another
    insert operation.

    How can I prevent the page from reloading? I though about disabling the
    back button but that not good for the hold application.
    bthumber, May 14, 2009
    1. Advertisements

  2. bthumber

    jay Guest

    how about use the cookie or session to record the insert action?
    jay, May 14, 2009
    1. Advertisements

  3. bthumber

    bthumber Guest

    Would that session be in a "if statement" else do something else?

    bthumber, May 14, 2009
  4. Its better to use cookie or session, you might hit the same problem
    with fwd button.

    S7 Software
    Ratnesh Maurya, May 15, 2009
  5. bthumber

    Chris Zopers Guest


    Reading your post I assume the insertion of the record takes place in
    the load event of the page???

    Isn't a more common scenario that the insertion of a record takes place
    when the user clicks on a button, like 'Save' or 'OK'?

    That way, there is no issue when the user navigates back (or forward) to
    the same page again. After saving, you could also clear all the fields
    and navigate to another page. When the user navigates back, all fields
    are cleared so when he/she clicks the save-button again, the data does
    not validate (assuming you validate the data before saving it) and won't
    be saved.

    Chris Zopers, May 15, 2009
  6. bthumber

    bthumber Guest

    I though of that, but that's not the way it designed, so I'm just working to
    stop the extra insert issue.

    bthumber, May 18, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.