ObjectDataSourceView.Deleted Event
Assembly: System.Web (in system.web.dll)
public: event ObjectDataSourceStatusEventHandler^ Deleted { void add (ObjectDataSourceStatusEventHandler^ value); void remove (ObjectDataSourceStatusEventHandler^ value); }
/** @event */ public void add_Deleted (ObjectDataSourceStatusEventHandler value) /** @event */ public void remove_Deleted (ObjectDataSourceStatusEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.
Handle the Deleted event to examine the values of a return value and output parameters or to determine whether an exception was thrown after a Delete operation has completed. The return value, output parameters, and exception handling properties are available from the ObjectDataSourceStatusEventArgs object that is associated with the event.
For more information about handling events, see Consuming Events.
The following code example demonstrates how to use an ObjectDataSource control with a business object and a GridView control to delete data. The GridView initially displays a set of all employees, using the method that is specified by the SelectMethod property to retrieve the data from the EmployeeLogic object. Because the AutoGenerateDeleteButton property is set to true, the GridView control automatically displays a Delete button.
If you click the Delete button, the Delete operation is performed using the method that is specified by the DeleteMethod property and any parameters that are specified in the DeleteParameters collection. In this code example, some preprocessing and post-processing steps are also performed. The NorthwindEmployeeDeleting delegate is called to handle the Deleting event before the Delete operation is performed, and the NorthwindEmployeeDeleted delegate is called to handle the Deleted event after the Delete operation has completed, to perform an exception handling. In this example, if a NorthwindDataException is thrown, it is handled by this delegate.
To examine the implementation of the EmployeeLogic middle-tier business object that this code example uses, see ObjectDataSourceStatusEventArgs.