The Control class does expose a Dispose event, but it does not have an OnDispose
method to raise it. Instead, providing a Dispose method follows the design pattern for objects
that work with scarce resources, implementing the IDisposable interface.
Life Cycle and the HTTP Protocols GET and POST
The page life cycle differs based on whether the web form is requested for the first time via an
HTTP GET or instead is initiated as part of a postback resulting from an HTTP POST generated by
a control element on the page submitting the web form back to the server. The HTTP POST
SaveControlState Save control state Persists a control??™s updated
control state through the
ViewState mechanism
Render Render process Generates HTML reflecting the
control??™s state and settings.
Dispose Dispose of control tree Releases any resources held by
the control before teardown.
Table 5-1. Server Control Events Related to the Control Execution Life Cycle
Server Control Event Page Life Cycle Phase Description
240 CHAPTER 5 ?– SE RVER CONTROL EVENTS
generally causes more life cycle activities because of the requirement to process data posted by
the client back to the web server, raising events associated with state changes.
Figure 5-21 shows the two variants (initial GET versus initial POST) of the web form life cycle
and the names of the phases we discuss in detail shortly.
Pages:
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344