Search code examples
c#asp.netlifecycle

Misfire lines of ASP.net C# codes due to interruptions


Is it possible that some line of codes fail to run due to slow internet connection and some kind of interruptions like Page refresh.

Imagine I have a massive line of codes with SQL queries, loops and conditional statements assigned to a button. The user clicked the button then immediately refresh the page, what will happen? Will all the code still fire or only some of it? And what should I do to prevent misfires?


Solution

  • The code should all fire if it is executed entirely on a server side controller / event triggered by the button, regardless of subsequent user activity.