refresh page causes a new insert into table

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
 
S

Steve B.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top