Resending/reposting info when refreshing

Discussion in 'ASP.NET / ASP.NET Core' started by Malin, Feb 23, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a database and a button. When clicking the button info is added to database.

    My problem is this.. when user clicks the "register" button and afterwards clicks the "refresh" button in IE a question is asked... "the page cannot be reloaded without resending the information". If you click the "retry" button in this dialogue the info is posted AGAIN to the database and this causes redundancy.

    How do I prevent this from happen? Is there a way to clear the information stored in the page when user clicks "register" button so if the user wants to click refresh no info is reposted.

    I have tried to write something like Request.Form.cls (don't remember exaktly). I thougt this would clear the array in wich the info was stored but everything crashed :(

    I could reload the page in the code under "register" button but I have this label with text "Info successfully registered to database" etc. If I reload the whole page this response to the user will disappear too.

    Can anyone help?

    Malin
     
  2. One way to prevent duplicate entrys in a database is to include the SessionID as a field in the database table. When a new entry is posted, check the current sessionID against the database to see if this client has already made an entry, and ignore further entries from this client if they have already done so.
     
  3. Thanks Jeremy

    But does your solution mean that a person also is forbidden to post another "message" even though this one is diffrent from the first one?

    I thought there would be an easy way to clear the memory of the webpage ...like form1.memory.cls [:p]

    Again, thanks for your help!

    Malin
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page