Occurs when a Delete operation has completed.
Assembly: System.Web (in System.Web.dll)
Handle the event to examine the values of a return value or 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.
You can use the AffectedRows property of the ObjectDataSourceStatusEventArgs object to return the number of rows that were deleted from the Delete method. To do this, set the AffectedRows property. If you return the number of deleted rows from the method that is specified by the DeleteMethod property, the value is available from the ReturnValue property of the ObjectDataSourceStatusEventArgs object.
For more information about handling events, see Consuming Events.
This section contains two code examples. The first code example demonstrates how to use an ObjectDataSource object with a business object and a GridView control to delete data. The second code example shows the EmployeeLogic class that is used in the first code example.
The following code example demonstrates how to use an ObjectDataSource control with a business object and a GridView control to delete data. Initially, the GridView control 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 operation is performed and the NorthwindEmployeeDeleted delegate is called to handle the event after the operation has completed to perform exception handling. In this code example, if a NorthwindDataException is thrown, it is handled by the NorthwindEmployeeDeleted method.
The following code example shows the EmployeeLogic class that is used in the preceding code example.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.