?
Solved

Unwanted ReInserts on Browser Refresh w/ASP,SQL Server

Posted on 1998-10-13
4
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 210 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

771 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