System.Web.UI.WebControls.DetailsView.DataKey Property

Gets a System.Web.UI.WebControls.DataKey object that represents the primary key of the displayed record.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public virtual DataKey DataKey { get; }

Value

Documentation for this section has not yet been entered.

Remarks

When the DetailsView.DataKeyNames property is set, the System.Web.UI.WebControls.DetailsView control automatically creates a System.Web.UI.WebControls.DataKey object that represents the key field or fields for the current record. Use the DetailsView.DataKey property to get this System.Web.UI.WebControls.DataKey object. This property is commonly used to obtain the keys and their corresponding values for the fields specified in the DetailsView.DataKeyNames property.

Note:

As a shortcut, you can also use the DetailsView.SelectedValue property to determine the value of the first key field listed in the DetailsView.DataKeyNames property.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0