views:

5

answers:

0

The order in which properties of some server control are databound depends on the order in which attributes with databind-expressions are written in the markup. I don't want to depend on this random factor.

Example:

<my:listcontrol runat="server" datasource=<%# src %> selectedvalues=<%# selected %> />

<my:listcontrol runat="server" selectedvalues=<%# selected %> datasource=<%# src %> />

In the former the DataSource property will be assigned before SelectedValues and control will be able to make some items from the data source selected. In the latter a control's developer need to save SelectedValues in an ugly temporary variable, because when it is assigned the items are not yet created.

Is there a way to control this databinding order? Maybe some attributes for properties?