This documentation is archived and is not being maintained.

EntityDataSource::Inserted Event

Occurs after a new object is created at the data source.

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

 event EventHandler<EntityDataSourceChangedEventArgs^>^ Inserted {
	void add (EventHandler<EntityDataSourceChangedEventArgs^>^ value);
	void remove (EventHandler<EntityDataSourceChangedEventArgs^>^ value);
<asp:EntityDataSource OnInserted="EventHandler" />

The Inserted event is raised when the added object is created in the data source or if an error has occurred when the object data is persisted to the data source. The Entity property of the EntityDataSourceChangedEventArgs object is used to access the added object.

The properties of this object contain values that are returned from the data source, including any data source-generated values.

If an error occurs when an object is persisted to the data source, the Inserted event is raised and the Exception property of the EntityDataSourceChangedEventArgs object is set to the returned Exception. If you handle the exception in the Inserted 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