You are on page 1of 1

In addition to the other posts, be aware that a postback is not the same

thing as a refresh. In other words, a postback does not just represent the
second (or subsequent) time the page is being loaded. A postback represents
just what its name says: a post-back of data to the server.
Usually, a submit button causes a postback, but as you've pointed out, many
controls have an "AutoPostBack" property which, when set to true, make using
that particular control act as if it was a submit button.
The code in the "If Not Page.IsPostBack" block is executed when the page
is loaded for the first time. This is used to set the initial values for
controls in the page. When the page loads for a postback, you don't want
to initialise the controls as you want them to get their values from the
data that the user posted.
If you instead want to do something when the page is loaded for a
postback, you use an "If Page.IsPostBack" statement, just as you
thought. This is not used very much, though, that's why you rarely see
it in examples. Usually you use the click event for the submit button to
perform anything on postback.