FormView::DataKey Property
.NET Framework (current version)
Gets a DataKey object that represents the primary key of the displayed record.
Assembly: System.Web (in System.Web.dll)
When the DataKeyNames property is set, the FormView control automatically creates a DataKey object that contains the key/value pairs of the field or fields listed in the DataKeyNames property for the current record. Use the DataKey property to get this DataKey object. This property is commonly used to obtain the keys and their corresponding values for the fields specified in the DataKeyNames property.
Note |
|---|
As a shortcut, you can also use the SelectedValue property to determine the value of the first key field listed in the DataKeyNames property. |
.NET Framework
Available since 2.0
Available since 2.0
Show:
