Refersh and IsPostback are somewhat unrelated:
- Updating in a browser usually means "re-executing the last action that led to this page." It usually calls a GET request, but it can also call POST if the page was shown as the result of a postback. Side of the note: you can often find sites warning you not to refresh the page during irreversible operations, such as “charge my credit card”, as this can lead to duplicate messages.
- IsPostBack simply states that the request arrives at the server as POST, not GET.
Combining this, you can get Refresh, which launches the if (IsPostBack) check branch. In most cases, the server receives a GET request and therefore executes the !IsPostBack branch.
If you really need to determine if the page has already been done, setting a cookie or writing information to Session would be a smart decision.
source share