View Single Post
Old August 13th, 2009, 02:20 PM
carewithl carewithl is offline
Authorized User
Join Date: Jun 2009
Posts: 32
Thanks: 17
Thanked 0 Times in 0 Posts

Originally Posted by Lee Dumond View Post
You are missing something. I think you're confusing the Page_Load of a user control with the Page_Load of a page.

In the host page life cycle, the ODS databinding takes place before the Page_Load of any user controls hosted in that page.
Uhm, are you sure about ODS data binding happening before Page_Load? If we add an ObjectDataSource with a Select method that returns an array of strings, a user control (.ascx) with a repeater that binds to the data source, and a page which added this user control, then the order of events is the following:

  MyObjectDataSource -> Init
UserControl -> Init
Page -> Init
Page -> Load
UserControl -> Load
MyObjectDataSource -> Load
Repeater1 -> DataBinding
MyObjectDataSource -> Selecting
MyObjectDataSource -> SelectMethod
Repeater1 -> DataBound
Thus UserControl.Load happens before MyObjectDataSource performs data binding. I’m probably (again) missing something very obvious?!

BTW - Nevermind my second question. I thought that ODS performs data binding on each postback, which apparently isn’t the case

cheers mate

Last edited by carewithl; August 13th, 2009 at 02:43 PM..