Export (0) Print
Expand All

EntityDataSource.Deleted Event

Occurs after an object has been deleted from the data source.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Entity (in System.Web.Entity.dll)

public event EventHandler<EntityDataSourceChangedEventArgs> Deleted
<asp:EntityDataSource OnDeleted="EventHandler" />

The Deleted event is raised after the SaveChanges method has just been successfully called on the ObjectContext to delete an object. The Entity property of the EntityDataSourceChangingEventArgs object is used to access the deleted object. This object is in a Detached state.

If an error occurs when an object is deleted, the Deleted event is raised, the Exception property of the EntityDataSourceChangedEventArgs object is set to the returned Exception, and the Entity property is set to null. If you handle the exception in the Deleted event handler, set the ExceptionHandled property to true. This prevents the exception from being raised again. When you specify a value of false for the ExceptionHandled property, the EntityDataSource re-raises the exception.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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.

.NET Framework

Supported in: 3.5 SP1

Community Additions

ADD
Show:
© 2014 Microsoft