Gets or sets the name of the method or function that the ObjectDataSourceView object invokes to delete data.
Assembly: System.Web (in System.Web.dll)
The method that is identified by the property can be an instance method or a static (Shared in Visual Basic) method. If it is an instance method, the business object is created and destroyed each time the method specified by the property is called. You can handle the ObjectCreated event to work with the business object before the method specified by the property is called. You can also handle the ObjectDisposing event that is raised after the method specified by the property is called. If the method is a static (Shared in Visual Basic) method, the business object is never created and you cannot handle these events.
If the business object that the ObjectDataSource control works with implements more than one method or function with the same name (method overloads), the data source control attempts to invoke the correct one according to a set of conditions, including the parameters in the DeleteParameters collection. If the parameters in the DeleteParameters collection do not match those of the method signature, the data source throws an exception.
The value of the property is stored in view state.
For more information, see DeleteMethod.
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 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 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.