Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Unwanted ReInserts on Browser Refresh w/ASP,SQL Server

Posted on 1998-10-13
4
Medium Priority
?
233 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
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 …
The viewer will learn how to dynamically set the form action using jQuery.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

610 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