Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506

    Red face Unanswered: 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.

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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).

  3. #3
    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

  4. #4
    Join Date
    Nov 2005
    Location
    Honolulu HI
    Posts
    119
    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.HawaiianHope.org
    Providing Technology services to non profit orgs, Homeless Shelters, Food Pantries, Clean And Sober Houses and more.
    To date we have given away over 900 free computers !
    __________________________
    caeli enarrant gloriam Dei !

  5. #5
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •