Solved

Unwanted ReInserts on Browser Refresh w/ASP,SQL Server

Posted on 1998-10-13
4
213 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 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
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.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

730 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