Because Dispose is the design pattern common in .NET, it is recommended
that you implement cleanup in Dispose instead of Unload to release unmanaged resources.
HTTP POST Request via Postback
Additional events and methods of the control life cycle are exercised once we execute a postback
of the Life Cycle web form by clicking the button. The output of the trace is much larger,
so the screen shot in Figure 5-23 is filled by that table.
248 CHAPTER 5 ?– SE RVER CONTROL EVENTS
Figure 5-23. The Lifecycle.aspx Trace output from an HTTP POST postback
The output from the Visual Studio Debug window confirms the sequence of events as well:
Lifecycle: Init Event.
Lifecycle: Track ViewState.
Lifecycle: Load Event.
Lifecycle: PreRender Event.
Lifecycle: Save ViewState.
Lifecycle: Save ViewState.
Lifecycle: Render Event.
Lifecycle: Unload Event.
CHAPTER 5 ?– SERVER CONTROL EVEN TS 249
Lifecycle: Dispose Event.
Lifecycle: Init Event.
Lifecycle: Track ViewState.
Lifecycle: Load PostBack Data Event.
Lifecycle: Load Event.
Lifecycle: Post Data Changed Event.
Lifecycle: PostBack Event.
Lifecycle: PreRender Event.
Lifecycle: Save ViewState.
Lifecycle: Save ViewState.
Lifecycle: Render Event.
Lifecycle: Unload Event.
Lifecycle: Dispose Event.
Pages:
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354