Refersh problem

B

bhavik

hi
i have one aspx page on which i have one button

in code behind i wrote a code for inserting a record.
if i clicik on button it inserts a record
ok ite fine
but the problem is that if i refresh the page
it will go again into button_click event and add the same record again

why so. ?

plz help me
 
R

Robert Koritnik

Because a HTTP_POST gets sent to the server. The best thing is that after
insertion you run Response.Redirect()...
 
W

WALDO

You could also turn SmartNavigation on for the Page. When you refresh it
doesn't re-submit. There's some caveats to doing that, though (like
overhead). Read up on it before you use it.



Sometimes the greatest solutions come from the simplest logic.
Being told no is merely the incentive to do it anyway.
 

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

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top