Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Clicking Refresh Button Resubmits Form

Reply
Thread Tools

Clicking Refresh Button Resubmits Form

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      09-17-2005
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 Sokalski

http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      09-17-2005
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
"Nathan Sokalski" <> wrote in message
news:%...
>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 Sokalski
>
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
 
 
 
Phil G.
Guest
Posts: n/a
 
      09-17-2005
Would the Page.IsPostback work for you?

Rgs, Phil

"Nathan Sokalski" <> wrote in message
news:%...
>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 Sokalski
>
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
Nathan Sokalski
Guest
Posts: n/a
 
      09-17-2005
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 Sokalski

http://www.nathansokalski.com/

"Phil G." <> wrote in message
news:dgi46u$qgr$...
> Would the Page.IsPostback work for you?
>
> Rgs, Phil
>
> "Nathan Sokalski" <> wrote in message
> news:%...
>>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 Sokalski
>>
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      09-18-2005
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


 
Reply With Quote
 
Joerg Jooss
Guest
Posts: n/a
 
      09-18-2005
Phil G. wrote:

> Would the Page.IsPostback work for you?


This will not work, as refresh resends the last request. A POST thus
stays a POST...

Cheers,
--
http://www.joergjooss.de
mailto:news-
 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-18-2005
Build Your ASP.NET Pages on a Richer Bedrock
http://msdn.microsoft.com/asp.net/co...rockaspnet.asp

Eliyahu

"Nathan Sokalski" <> wrote in message
news:%...
> 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 Sokalski
>
> http://www.nathansokalski.com/
>
>



 
Reply With Quote
 
Patrick.O.Ige
Guest
Posts: n/a
 
      09-19-2005
Go through Teri's article at:-
http://aspalliance.com/687
It should help
Patrick


"Eliyahu Goldin" <> wrote in message
news:...
> Build Your ASP.NET Pages on a Richer Bedrock
>

http://msdn.microsoft.com/asp.net/co...to/default.asp
x?pull=/library/en-us/dnvs05/html/bedrockaspnet.asp
>
> Eliyahu
>
> "Nathan Sokalski" <> wrote in message
> news:%...
> > 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 Sokalski
> >
> > http://www.nathansokalski.com/
> >
> >

>
>



 
Reply With Quote
 
Deepak Dhawan
Guest
Posts: n/a
 
      09-21-2005
use Redirect to give output that means with redirect the output page
will be different and now postback will not be there

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing browser resubmits perl script llbbl Perl Misc 3 06-09-2006 04:40 PM
Clicking Refresh Button Resubmits Form Nathan Sokalski ASP .Net 8 09-21-2005 07:08 AM
weblogic timeout resubmits forms Greg Smith Java 1 11-15-2004 02:58 PM
All procedures run when clicking on the refresh button of the explorer Mike John ASP .Net 0 07-31-2003 05:42 PM
page refresh resubmits input form data! lucas ASP .Net 0 07-30-2003 09:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57