ASP.NET InitComplete event
Can i Consider the responsibility of InitComplete event as foll开发者_运维技巧ows
1) It is the last stage of page initialization
2) If ViewState is enabled at page level it will calls Page.TrackViewState() method inorder to make the view state to be ready for persisted across postback.
Thanks Babu
According to MSDN
Raised at the end of the page's initialization stage. Only one operation takes place between the Init and InitComplete events: tracking of view state changes is turned on. View state tracking enables controls to persist any values that are programmatically added to the ViewState collection. Until view state tracking is turned on, any values added to view state are lost across postbacks. Controls typically turn on view state tracking immediately after they raise their Init event.
Use this event to make changes to view state that you want to make sure are persisted after the next postback.
1) It is the last stage of page initialization
Yep
2) If ViewState is enabled at page level it will calls Page.TrackViewState() method inorder to make the view state to be ready for persisted across postback.
Nope, by the time you get to InitComplete, ViewState tracking has already been turned on. As the last section of the documentation states, purpose of the even is to changes to the ViewState.
精彩评论