In ASP .NET code, I see lot of if(!IsPostBack)
checks.
Let's take an example of ASP.NET MVC, when request is made to a controller method for the first time, it serves a view, say it is a razor page in this case. In this first request the IsPostBack
will be false.
Once the view is served by the controller, is the same controller method called again automatically without any user interaction? And this time IsPostBack
will be true?
Or the controller method is only called on some user interaction, say user submits a form or something similar, then controller action method is called and the IsPostBack
flag is true?