Hello. There is a problem. If you add an entry and then make an update of the page. So for some reason, the handler of the button for saving data is triggered once again and the same data is again saved in the database. That is, the record is duplicated. Why can this happen? Why does the f5 trigger once again when the page is updated with the f5 button?

  • 2
    Please attach the code)) - isaikinvv
  • The action code of the controller (in which the form leads) to the studio! The form, by the way, can also be useful. And what kind of framework is used on top of ASP.NET? - free_ze
  • @free_ze is the problem. If I just update the page with nothing to do before. That is, I went to her and poke f5. That is not a post back. But if I, for example, first make an addition or any other action. Then, when the page is updated, the code passes the IsPostBack condition and in the requester the params returns my last action to me and as a result, the last handler that I used before updating the page is triggered. What could be the problem? Not cleaned post back request or what? - Andrei
  • Because F5 in your browser repeats the last request sent. This is normal for browsers. You need to either make requests via ajax, or refresh the browser page via ctrl + f5 (or shift + f5, I don’t remember exactly) - tym32167
  • @ tym32167, thanks. And with ajax requests, the browser does not repeat the last post back request? - Andrei

0