Occurs before a delete operation.
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
Handle the LinqDataSource control passes a LinqDataSourceDeleteEventArgs object to event handlers for the event. The LinqDataSourceDeleteEventArgs object contains the data that will be deleted and enables you to cancel the delete operation. If the data class throws a LinqDataSourceValidationException exception, the LinqDataSourceDeleteEventArgs object contains that exception in the Exception property.event to validate the object to be deleted, to examine data validation errors from the data class, to change a value before the delete operation, or to cancel the delete operation. The
If an exception is thrown in an event handler for the Deleted event (through the Exception property of the LinqDataSourceStatusEventArgs object). The Exception property contains only the exceptions that are thrown after the event.event, you must handle the exception in that event handler. The exception will not be passed to an event handler for the
The following example shows an event handler for the OriginalObject property and a value from the Web page. In the example, when the OnSale property is set to true, the user must select a CheckBox control to confirm that a record should be deleted.event. The code cancels the delete operation based on a property in the
Available since 3.5