Gets or sets a value indicating whether the built-in control to delete the current record is displayed in a DetailsView control.
Assembly: System.Web (in System.Web.dll)
When a DetailsView control is bound to an object that inherits from DataSourceView and the CanDelete property returns true, the DetailsView control can take advantage of the data source control's capabilities and provide automatic deleting functionality.
You must also set the DataKeyNames property for the automatic deletion feature to work.
The DetailsView control provides several events that you can use to perform a custom action when a record is deleted. The following table lists the available events.
Occurs when the Delete button is clicked, but after the DetailsView control deletes the record from the data source. This event is often used to check the results of the delete operation.
Occurs when the Delete button is clicked, but before the DetailsView control deletes the record from the data source. This event is often used to cancel the delete operation.
The value ofis stored in view state.
Available since 2.0