System.Web.UI.WebControls.FormViewUpdatedEventArgs Class

Provides data for the FormView.ItemUpdated event.

See Also: FormViewUpdatedEventArgs Members


public class FormViewUpdatedEventArgs : EventArgs


The System.Web.UI.WebControls.FormView control raises the FormView.ItemUpdated event when an Update button (a button with its CommandName property set to "Update") within the control is clicked, but after the System.Web.UI.WebControls.FormView control updates the record. This allows you to provide an event-handling method that performs a custom routine, such as checking the results of an update operation, whenever this event occurs.

A System.Web.UI.WebControls.FormViewUpdatedEventArgs object is passed to the event-handling method, which allows you to determine the number of records affected and any exceptions that might have occurred. To determine the number of records affected by the update operation, use the FormViewUpdatedEventArgs.AffectedRows property. Use the FormViewUpdatedEventArgs.Exception property to determine whether any exceptions occurred. You can also indicate whether the exception was handled in the event-handling method by setting the FormViewUpdatedEventArgs.ExceptionHandled property. If you need to access the original key field values for the updated record, use the FormViewUpdatedEventArgs.Keys property. The original non-key field values can be accessed by using the FormViewUpdatedEventArgs.OldValues property. Updated values (which include updated key field values, if you allow the user to edit key fields) are accessed using the FormViewUpdatedEventArgs.NewValues property.

By default, the System.Web.UI.WebControls.FormView control returns to the mode specified by the FormView.DefaultMode property after an update operation. When handling an exception that occurred during the update operation, you can keep the System.Web.UI.WebControls.FormView control in edit mode by setting the FormViewUpdatedEventArgs.KeepInEditMode property to true.

For more information about handling events, see Consuming Events.

For a list of initial property values for an instance of the System.Web.UI.WebControls.FormViewUpdatedEventArgs class, see the FormViewUpdatedEventArgs.#ctor(int, Exception) constructor.


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