Occurs when the FormView control switches between edit, insert, and read-only mode, but before the mode changes.
Assembly: System.Web (in System.Web.dll)
The FormView control attempts to switch between edit, insert, and read-only mode, but before the mode actually changes. This allows you to provide an event-handling method that performs a custom routine, such as configuring the FormView control for a specific mode or canceling the mode change, whenever this event occurs.event is raised when a
A FormViewModeEventArgs object is passed to the event-handling method, which allows you to determine the mode to which the FormView control is switching, to determine whether the event was raised as a result of the user canceling an edit operation, or to indicate that an insert operation should be canceled. To determine the new mode, use the NewMode property. You can also use the NewMode property to switch to an alternate mode by setting it to one of the FormViewMode enumeration values. Use the CancelingEdit property to determine whether the user canceled an edit operation. To cancel an insert operation, set the Cancel property to true.
For more information about handling events, see NIB: Consuming Events.
Available since 2.0