asp.net.ph

FormView.SelectedValue Property

System.Web.UI.WebControls Namespace   FormView Class


.NET Framework version 2.0

Returns the data key value of the current row in a FormView control.

Syntax


Script [ Object objDataKeyvalue = ] FormView.SelectedValue

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value


objDataKeyvalue An object specifying the data key value of the current row in a FormView control.

The property is read only with no default value.

Remarks

Use the SelectedValue property to determine the data key value of the current row in the FormView control.

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.

The DataKey object represents the primary key field or fields for the current record and is stored in the FormView control's DataKey property. Instead of using the DataKey property to access the data key value, you can instead simply use the SelectedValue property.

NOTE: When the DataKeyNames property lists multiple fields, this property returns only the value of the first field listed.

Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph