System.Web.UI.WebControls.FormView.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 FormView.DataKeyNames property is set, the System.Web.UI.WebControls.FormView control automatically creates a System.Web.UI.WebControls.DataKey object that contains the key/value pairs of the field or fields listed in the FormView.DataKeyNames property for the current record. Use the FormView.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 FormView.DataKeyNames property.

Note:

As a shortcut, you can also use the FormView.SelectedValue property to determine the value of the first key field listed in the FormView.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