Export (0) Print
Expand All

BaseDataList.DataSourceID Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the ID property of the data source control that the data listing control should use to retrieve its data source.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

[ThemeableAttribute(false)] 
public virtual string DataSourceID { get; set; }
/** @property */
public String get_DataSourceID ()

/** @property */
public void set_DataSourceID (String value)

public function get DataSourceID () : String

public function set DataSourceID (value : String)

Property Value

The programmatic identifier assigned to the data source control.

Exception typeCondition

HttpException

The data source cannot be resolved because a value is specified for both the DataSource property and the DataSourceID property.

Use the DataSourceID property to access the ID property of the data source control that the data listing control should use to retrieve its data source. The data source control referenced by the DataSourceID property can be any control that implements the IDataSource interface. The data source control must exist either in the same naming container as the data listing control that references it, or in a parent control of the data listing control. When you specify a value for this property, the data listing control automatically binds to the specified data source control. You do not need to write code that explicitly calls the DataBind method.

Alternately, you can use the DataSource property to specify the source of values to bind to a data listing control. The data source must be an object that implements the System.Collections.IEnumerable interface (such as System.Data.DataView, System.Collections.ArrayList, or System.Collections.Hashtable) or the IListSource interface to bind to a control derived from the BaseDataList class. When you set the DataSource property, you must manually write the code to perform data binding.

If values are specified for both the DataSource property and the DataSourceID property, ASP.NET is not able to resolve the data source and an System.Web.HttpException exception is thrown.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins Overview.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft