What is the difference of DataSourceID and DataSource from the controls\' attribute? Can I use them interchangeably?
When I try to set DataSource
prope
DataSource: Gets or sets the object from which the data-bound control retrieves its list of data items. (Inherited from BaseDataBoundControl
.)
DataSourceID: Gets or sets the ID of the control from which the data-bound control retrieves its list of data items. (Inherited from DataBoundControl
.)
Secondly they can be used interchangeably
, but you have to use carefully. e.g. If you first assign dataSourceID
and then want to use DataSource
, then before using DataSource
, you have to clear the datasourceID by setting ControlID.DataSourceID = ""