Clicking Refresh Button Resubmits Form

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have a form that submits data to a database. If I click the browser's
refresh button after submitting the form once, the form is submitted a
second time. How can I avoid this problem? Thanks.
 
Nathan,

You could send the results page a response.redirect or go to a different
page with a meta refresh. Either way, you need to get the client machine to
a page that wasn't produced by submitting form data. So the logic would be:

Client posts form data on submit.

Server processes data and stores results for future display (if necessary)
in a session variable or elswhere.

Server sends client as the result of the form post a redirect or meta
refresh which sends client to a new page that wasn't produced via posted
data.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
I tried the Page.IsPostback() and it doesn't help. If I use the condition
Not Page.IsPostback() then I can't submit at all, and if I use
Page.IsPostback() it still gives me the resubmitting problem with the
refresh button.
 
Nathan,

Any reason why you have the newsgroup AdoNet in this crossposting. In other
words, with what can we help you that is AdoNet related?

Cor
 
use Redirect to give output that means with redirect the output page
will be different and now postback will not be there
 
Back
Top