Gets or sets the field from the data source to bind to the System.Web.UI.WebControls.ListItem.Text property of each item in the System.Web.UI.HtmlControls.HtmlSelect control.
Documentation for this section has not yet been entered.
Use the HtmlSelect.DataTextField property to specify which field from the data source to bind to the System.Web.UI.WebControls.ListItem.Text property of each item in the control. This property is commonly used to provide a value for the System.Web.UI.WebControls.ListItem.Text property that differs from the value of the System.Web.UI.WebControls.ListItem.Value property.
The System.Web.UI.HtmlControls.HtmlSelect class provides two properties for specifying the data source to bind to. The HtmlSelect.DataSource property allows you to bind an System.Web.UI.HtmlControls.HtmlSelect control to any collection that implements the IEnumerable or System.ComponentModel.IListSource interfaces (such as System.Data.DataView, ArrayList, or List`1). When you use the HtmlSelect.DataSource property to specify the data source, you must explicitly call the System.Web.UI.Control.DataBind method to bind the control and its HtmlSelect.DataTextField property to the data source.
The HtmlSelect.DataSourceID property allows you to bind an System.Web.UI.HtmlControls.HtmlSelect control to a data source control that represents a data source. When you use the HtmlSelect.DataSourceID property to specify the data source, the System.Web.UI.HtmlControls.HtmlSelect control and its HtmlSelect.DataTextField property automatically bind to the specified data source control. Therefore, you do not need to explicitly call the System.Web.UI.Control.DataBind method.