This is due to how browsers work. The first time you POST the page, the browser sends all the data, then returns back HTML to render. If you hit refresh (F5) then the browser re-sends the last POST request thus re-sending the information again. This causes duplication of record. One need to apply Post-Redirect-Get pattern for such scenarios/pages, where after an HTTP Post, instead of returning HTML, is
redirected back to a page (either the same or another).
In case, you cannot redirect or not comfortable with redirect, have a look at these articles:
Refresh Page Issue in ASP.Net[
^]
Stop Refresh after Submitting your Request[
^]
Detecting Page Refresh[
^]