views:

568

answers:

2

At what point does a ASP.Net Object Data Source bind data, from the specified data source, in the page life cycle?

+1  A: 

From the Page Life Cycle Overview, referring to the databinding event:

This event is raised by data-bound controls before the PreRender event of the containing control (or of the Page object) and marks the beginning of binding the control to the data.

And regarding the DataBound event:

This event marks the end of data-binding operations in a data-bound control. In a GridView control, data binding is complete for all rows and any child controls. Use this event to format data bound content or to initiate data binding in other controls that depend on values from the current control's content.

Joel Coehoorn
A: 

As Joel stated, binding happens in PreRender. If your really interested you can take a look at BaseDataBoundControl.OnPreRender and you'll see the code that is responsible for this.

dfowler