ListViewUpdateEventArgs::Keys Property
Gets a dictionary of field name/value pairs that represent the key or keys of the item to update.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Property Value
Type: System.Collections.Specialized::IOrderedDictionary^The field name/value pairs that represent the key or keys of the item to update.
When the DataKeyNames property of a ListView control is set, use the Keys property (dictionary) to access the value of the primary key in the item to update.
Note |
|---|
To access the values of the non-key fields, use the NewValues or OldValues properties. The NewValues property contains the updated values, and the OldValues property contains the original values. |
The Keys dictionary is automatically populated with the name/value pairs of the field or fields specified in the DataKeyNames property. If multiple fields form the primary key, a separate entry is added to the Keys dictionary for every key field.
To determine the name of a key field, use the DictionaryEntry::Key property of a DictionaryEntry object that is contained in the Keys dictionary. To determine the value of a key field, use the DictionaryEntry::Value property.
The following example shows how to use the Keys property to access the value of the key field for the record being updated.
Security Note
|
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
Available since 3.5

