In this example, we will be looking briefly at the Life Cycle of an ASPX page, and how an Asynchronous PostBack still follows the same events as a normal PostBack. We will be adding two buttons and a BulletedList to our ASPX page:

We will use the Buttons to post back the page and then we will assign the datasource of the BulletedList in the code-behind. We will be outputting the results of the following four events:
Page_PreInit, Page_Init, Page_Load, and Page_PreRender.

We will set a Frue or False on each of these events if it’s current state is in AsyncPostBack. This means that we will be able to tell which events are fired, if we put one button inside the UpdatePanel, and one outside of it. This way, way can call both an Async PostBack and a full PostBack and compare the True/False responses.
Let’s go ahead and add the ScriptManager and the UpdatePanel:

Now we have our form set-up as we want it, we can turn our attention to the code-behind. Here, we will add to an ArrayList on each of our events.
By doing this, we will be able to see which events are called when we alternate between Async and Normal PostBacks. Here is what our code will look like:

Now when we run our Web Application, you will notice that the Async button will set all the values to True except PreInit. This is because the IsAsyncPostBack Property gets updated after this event is called.

Download Source Files