Hi, thanks for the response,
Yeh I know about the page lifecycle but my problem is that the child controls are being created before their parent control. I want them to be created by the parent control in the CreateChildControls() method but they're not being. It seems the page is creating them so they end up with no parent (this.Parent is null) and no page (this.Page is null) and the viewstate doesn't work at all.
Main Topics
Browse All Topics





by: kev-doggPosted on 2007-08-07 at 11:03:40ID: 19648227
The OnInit method is the first method that is called in the page lifecycle. LoadViewState is the third method so your viewstate data is not available when the child controls are initialized. The control is stable in the Load event where it has been initialized and the state has been reconstructed.