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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
ahmed kabir4 reputationPosted Sep 24, 2014, 9:37 PM EDT
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.
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 16, 2014, 9:22 PM EST
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
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 16, 2014, 10:05 PM EST
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.
Infosoft beena121 reputationPosted Oct 27, 2015, 5:19 AM EDT