There is a pattern called PRG (POST - Redirect - GET). You can follow it to avoid duplicate insertions. Its simply like POST the data to the server, and redirect it to the same or different page.
There are other ways too if you want, which can be easily searched. Have a look at the discussion
here[
^].