System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Occurs when an Update command button within a FormView control is clicked, but before the update operation.
[ VB ]
Public Event ItemUpdating As FormViewUpdateEventHandler
[ C# ]
public event FormViewUpdateEventHandler ItemUpdating;
[ C++ ]
public: __event FormViewUpdateEventHandler* ItemUpdating;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The ItemUpdating event is raised whenever an Update button associated with an item in the FormView control is clicked, but before the FormView control updates the record.
This allows you to provide an event-handling method that performs a custom routine, such as checking the values of a record before updating it in the data source, whenever this event occurs.
Information related to the ItemUpdating event is passed via a FormViewUpdateEventArgs object to the method assigned to handle the event. The following FormViewUpdateEventArgs properties provide information specific to this event.
Property |
Description |
Cancel |
Gets or sets a value indicating whether the event should be canceled ( inherited from CancelEventArgs ) |
CommandArgument |
Gets the command argument for the insert operation passed to the FormView control. |
Keys |
Gets a dictionary that contains the key field name/value pairs for the record to update. |
NewValues |
Gets a dictionary that contains the new field name/value pairs for the record to update. |
OldValues |
Gets a dictionary that contains the original non-key field name/value pairs for the record to update. |
FormView Members Allowing Users to Edit Rows in a FormView Control