Hello,
This is really bugging me, so I hope someone can help me a bit
1) Assuming page contains user control, then *Page.Page_Load* is fired prior to *UserControl.Page_Load*:
a) I assume that if Page contains ObjectDataSource1 control, then ObjectDataSource1 will perform data binding prior to *UserControl.Page_Load*?!
b) If that is the case, then does Page.Prerender also happen prior to *UserControl.Page_Load*?
c) If UserControl contains ObjectDataSource2 control, will this control perform data binding at the same time as ObjectDataSource1 (which is contained directly inside Page)?
But that wouldn’t make much sense, since I would assume controls inside UserControl follow UserControl’s life cycle and not Page’s?!
Anyhow, I thought that web page hosting user control can’t receive events or call methods of controls contained inside user control?!If so, then how is web page able to call databind on ObjectDataSource2?
thanx
EDIT:
The main source of my confusion is the following quote from some book:
…user's country, state and city are read only once from the profile and saved in local variables. UserControl.Page_Load cannot be used for this because automatic binding done by the UserControl.ObjectDataSource happens earlier, so we have to use the UserControl.Page_Init event handler
I assume in the above quote author suggests that if user control contains ODS, then this ODS will perform data binding prior to UserControl.Page_Load, which is not what you've stated?
BTW - user control the above quote is talking about is added to web page at design time
ANOTHER EDIT:
I did some googling and the book(or part of it) is available at the following link.
Anyways, the quote is taken from page 257, which is basically a part of a section describing ArticleListing.ascx user control.
BTW – just so you won’t think I’m delusional … I don’t expect anyone to read the whole section on that user control, I just thought that perhaps code on page 257 would provide sufficient context to figure out what author actually meant