ASP.NET - What is the difference of DataSourceID and DataSource?

前端 未结 3 1459
一向
一向 2021-01-17 10:54

What is the difference of DataSourceID and DataSource from the controls\' attribute? Can I use them interchangeably?

When I try to set DataSource prope

3条回答
  •  自闭症患者
    2021-01-17 11:28

    DataSource refers to actual data source object which can be .NET provided data source controls (such as ObjectDataSource, SqlDataSource) or actual data objects such as DataTable, Collection of objects etc.

    DataSourceID is the string identifier for .NET provided data source control and this property exists so that data-bound control and corresponding data source can be associated at the design time in markup. Internally, the control would look up for actual data source control using the id provided.

提交回复
热议问题