If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Refresh Button Problem while data adding

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-23-06, 13:44
rudra rudra is offline
L O S T in Reality
 
Join Date: Nov 2005
Location: San Francisco, CA
Posts: 506
Red face Refresh Button Problem while data adding

Hi,
Can anybody help me? I have a problem while adding data in asp.While I add a record its adding the record to the database.But if i press the refresh button Of Internet explorer it is adding the same data again.I want to stop this.
Anybody can help me out.
Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-23-06, 16:51
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
well the refresh is just repeating the last http post that was made (so if you clicked the save button to save a record you are effectively doing the same by pressing refresh.

getting rid of any caching may solve this problem but I doubt it will work on all browsers...

the best bet is to add a check so that before you save you make sure there is no record existing that is the same as what you have added (this may not help if the data you are adding has not unique identifiers).
Reply With Quote
  #3 (permalink)  
Old 01-28-06, 11:34
rudra rudra is offline
L O S T in Reality
 
Join Date: Nov 2005
Location: San Francisco, CA
Posts: 506
but I want to know the way to get rid of Internet explorer history.Is there any javascript to do so?Plz help if u can....
Thanks in advance
Joydeep
Reply With Quote
  #4 (permalink)  
Old 01-29-06, 01:00
kropes2001 kropes2001 is offline
Registered User
 
Join Date: Nov 2005
Location: Honolulu HI
Posts: 118
there is no need to get rid of the hisrory.

if you make your form properly, and use some type of variable (like a session cookie) that only exists when you are submitting the form...
after you enter into the process of updating the database you clear/wipe that variable.... so then if you hit refresh, the variable no longer exists, the database does not get updated again
__________________
.
.
http://www.GetMySiteOnline.com - Can you help me Get My Site Online ? (Yes. That is EXACTLY what we do.)

http://www.GetMySiteOnline.com/FightingSpam/
__________________________
caeli enarrant gloriam Dei !
Reply With Quote
  #5 (permalink)  
Old 01-30-06, 18:00
rudra rudra is offline
L O S T in Reality
 
Join Date: Nov 2005
Location: San Francisco, CA
Posts: 506
Sorry,the way u stated doesn't make any sense.Just tell me if I create a session variable as
session("updat_ok")=true and make it false when I have done with the update ,where will I put the session(updat_ok)=true?
The checking is ok in the update.asp page but in the submit page where will u put the session(updat_ok)=true?
Joydeep
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On