ListControl.DataValueField Property

Gets or sets the field of the data source that provides the value of each list item.

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

[ThemeableAttribute(false)] 
public:
virtual property String^ DataValueField {
	String^ get ();
	void set (String^ value);
}
/** @property */
public String get_DataValueField ()

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

public function get DataValueField () : String

public function set DataValueField (value : String)

Not applicable.

Property Value

A System.String that specifies the field of the data source that provides the value of each list item. The default is String.Empty.

Use this property to specify the field that contains the value of each item in a list control.

The value of this property is stored in view state.

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

The following example demonstrates how to specify the DataValueField for the RadioButtonList control. The DataValueField is the value for the each item in the RadioButtonList.

No code example is currently available or this language may not be supported.

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: