refresh page causes a new insert into table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I've made a web form (C#) with a 'save' button on the bottom of the form.

when the user saves (button click) the data it is inserted into a db table.
I notify the user with a javascript alert and the save button will be
disabled.
The text boxes are still filled with the input of the user.

When I press F5 (refresh) the form wants to save the data again!?

I hoped the text boxes where cleared and the browser showed a new empty
'instance' of the form...

Any ideas how this can be done..?

Cheers
 
After the insertion, you can "redirect" to the current page...

You can also store the user's last action (hero) in a viewstate field in
order to test if the requested action is not the same than the last executed
one...

HTH.
Steve
 
Back
Top