473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clicking Refresh Button Resubmits Form

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
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
8 1708
Nathan,

You could send the results page a response.redire ct 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" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #2
Would the Page.IsPostback work for you?

Rgs, Phil

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #3
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
nj********@hotm ail.com
http://www.nathansokalski.com/

"Phil G." <Ph**@nospam.co m> wrote in message
news:dg******** **@nwrdmz02.dmz .ncs.ea.ibs-infra.bt.com...
Would the Page.IsPostback work for you?

Rgs, Phil

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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
nj********@hotm ail.com
http://www.nathansokalski.com/


Nov 19 '05 #4
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
Nov 19 '05 #5
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:ne****** **@joergjooss.d e
Nov 19 '05 #6
Build Your ASP.NET Pages on a Richer Bedrock
http://msdn.microsoft.com/asp.net/co...rockaspnet.asp

Eliyahu

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #7
Go through Teri's article at:-
http://aspalliance.com/687
It should help
Patrick
"Eliyahu Goldin" <re************ *@monarchmed.co m> wrote in message
news:eo******** ******@tk2msftn gp13.phx.gbl...
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.a sp
Eliyahu

"Nathan Sokalski" <nj********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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
nj********@hotm ail.com
http://www.nathansokalski.com/


Nov 19 '05 #8
use Redirect to give output that means with redirect the output page
will be different and now postback will not be there

Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3317
by: laura | last post by:
I'm doing a page which gathers some text in the form of a text box in a <form>. This text is saved to a text file, notices.txt and I want to be able to display the saved text on the page, as soon as they click the SUBMIT button - is this possible? At the moment I have a hyperlink called "back" which, once they have entered the text and they...
2
3805
by: anonieko | last post by:
Scenario: You have a page that is TOO slow to refresh. But it allows partial flushing of html contents. I.e. Submit button already appears but you don't want your users to click on it prematurely because other parts are still coming. Here I put a javascript the will enable only submit button only after 5 seconds after the page is load...
0
4217
by: lucas | last post by:
Hi, I have a simple input form that i use to add records to a sql server database. Bellow that is a datagrid that has one template column that I use to dispaly the 3 fields with some html formating. the datagrid also has paging. I'm doing a ASP.NET guestbook. I know some things could be improved like adding some error handling and caching...
10
9231
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side click event and I update session information to track the visibilty of some panels in a wizard type navigation ("Next >>" and "<< Back" buttons).....
8
2397
by: Nathan Sokalski | last post by:
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 njsokalski@hotmail.com http://www.nathansokalski.com/
9
1521
by: Mr Newbie | last post by:
Before someone flames me, I know this is the VB.NET groups, nonetheless, the asp.net guys seems to have almost disapeared from the aspnet groups so I thought I would ask this here. I have a problem with an aspx web form in that if I refresh, it simply resubmits the form and causes multiple submissions, in this case the form is one which...
2
276
by: Mr Newbie | last post by:
Before someone flames me, I know this is the VB.NET groups, nonetheless, the asp.net guys seems to have almost disapeared from the aspnet groups so I thought I would ask this here. I have a problem with an aspx web form in that if I refresh, it simply resubmits the form and causes multiple submissions, in this case the form is one which...
10
3774
by: Martien van Wanrooij | last post by:
In a simple webshop application I am trying to check that the "shopping cart" only should be "filled" when you choose an article in "meerinfo.php" and click on a link to "winkelwagen.php". It works fine in that sense that when I would enter in the browser "www.mysite.php/winkelwagen?id=5"it will be ignored. However when I go from...
9
4134
by: Navaneet | last post by:
Hi, Can anyone tell me how to prevent some particular POST DATA when refresh button (F5) clicked on server side(vb.net). Thanks Kumar N
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.