as i am developing a web application in asp.net, There is 4 text boxes to provide user deatils and a button to save the information in DB. When User click the button to Insert the user deatil, it is saved in DB perfectly, but the problem is when the user Refreshes the page, that data is again re inserted / resubmitted, i want to make sure that duplicate submission should be avoided .
Please any suggestion, code samples, to avoid this situation are welcome ( in c#)
Use the Post-Redirect-Get (also known as Redirect after post) pattern. It simply consists in redirecting after a successful post, so that the user refresh results in an idempotent GET to be done rather than a POST. It has the additional advantage that the browser “forgets” about the POST in its history, which means the back button won’t submit either.