Hi All,
How to stop form refresh in web form. When i am saving the record and clicking the refresh button the data saved again.
how to stop refresh button.
Any idea.
Warms & Regards
Jagat
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Infosoft beenaPosted Oct 27, 2015, 9:19 AM
ahmed kabirPosted Sep 25, 2014, 1:37 AM
One of most common issue which many of the web developers face in their web applications, is that the duplicate records are inserted to the Database on page refresh. If the web page contains some text box and a button to submit the textbox data to the database. In that case when the user insert some data to the textbox and click on the submit button, it will save the record to the Database and then if the user refresh the web page immediately then the same record is again saved to the database as there is no unique keys that can be used to verify the existence of the data, so as to prevent the multiple insertion.
From this behavior we can definitely know that, on the page fresh the button click event is fired.
On page load event save the date/time stamp in a session variable, when the page is first loaded, a Session variable is populated with the current date/time as follows:
Then these two values are compared to each other immediately before the database INSERT command is run.
Jignesh TrivediPosted Jan 17, 2014, 3:05 AM
you can also redirect page after save message to any other page like grid page if any.
how you save your data? using Form post? also provide some information about technologies which is used.
Satyapriya NayakPosted Jan 17, 2014, 2:22 AM
http://www.aspsnippets.com/Articles/ASP.Net---Prevent-DuplicateDouble-Inserts-when-Page-is-refreshed.aspx
http://aspalliance.com/687_Preventing_Duplicate_Record_Insertion_on_Page_Refresh
http://www.codeproject.com/Articles/6413/Stop-Refresh-after-Submitting-your-Request
http://www.dotnetvishal.com/2012/10/avoid-duplicate-record-insertion-on.html