FormView.DataKey Property
.NET Framework 3.0
Gets a DataKey object that represents the primary key of the displayed record.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
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. |
Community Additions
ADD
Show:
Note: