Solved

Unwanted ReInserts on Browser Refresh w/ASP,SQL Server

Posted on 1998-10-13
4
189 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for your help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now