Solved

Unwanted ReInserts on Browser Refresh w/ASP,SQL Server

Posted on 1998-10-13
4
205 Views
Last Modified: 2013-12-25
I have an ASP script that takes information from an HTML form and inserts it into an SQL server database. Everytime a user refreshes the page, the date is inserted again. I could use a Session variable to temporarlily halt the inserts, but this would keep the user from going back to the form and entering more data and if the variable timed out the same problem would exist.Recommendations?
0
Comment
Question by:tgoglia
  • 2
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 70 total points
ID: 1829065
Don't do any HTML output on the page that updates the database, but in stead, after updating, do a redirect to another page:
Response.redirect("someotherpage.asp").

This page should just display stuff, no database inserts.
When the user presses reload, then just this page will be reloaded.
0
 

Author Comment

by:tgoglia
ID: 1829066
The problem with this solution is that I am actually using a stored porcedure that first inserts information into the database, then returns information about what was submitted to the user. I can't redirect the user to another page and still display the results of the insert from the ADO recordset
0
 
LVL 28

Expert Comment

by:sybe
ID: 1829067
ideas:
- store the returned data in a sessionvariable
- store the returned data into hidden fields of a form and an autosubmit of the form with javascript, then display the data
0
 

Author Comment

by:tgoglia
ID: 1829068
Thanks for your help.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question