This documentation is archived and is not being maintained.

DataList.SelectedValue Property

Gets the value of the key field for the selected data list item.

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

public Object SelectedValue { get; }
/** @property */
public Object get_SelectedValue ()

public function get SelectedValue () : Object

Not applicable.

Property Value

The key field value for the selected data list item. The default is a null reference (Nothing in Visual Basic), which indicates that no data list item is currently selected.

Exception typeCondition

InvalidOperationException

The DataKeyField property has not been set.

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
Show: