ObjectDataSourceView::OnDeleted Method
Raises the Deleted event after the ObjectDataSourceView object has completed a delete operation.
Assembly: System.Web (in System.Web.dll)
Parameters
- e
- Type: System.Web.UI.WebControls::ObjectDataSourceStatusEventArgs
An ObjectDataSourceStatusEventArgs that contains the event data.
Raising an event invokes the event handler through a delegate. For more information, see Consuming Events.
The OnDeleted method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors:When overriding the OnDeleted in a derived class, be sure to call the OnDeleted method for the base class so that registered delegates receive the event.
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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.