This documentation is archived and is not being maintained.
EntityDataSourceContextDisposingEventArgs Class
Visual Studio 2008
Provides data for the ContextDisposing event.
Assembly: System.Web.Entity (in System.Web.Entity.dll)
Handle the ContextDisposing event, and set the Cancel property of the EntityDataSourceContextDisposingEventArgs to true. This prevents the disposal of the ObjectContext. For more information, see Object Context Life-Cycle Management (EntityDataSource).
This example maintains the ObjectContext for future reference by handling the ContextCreated event.
protected void EntityDataSource2_ContextDisposing(object sender,
EntityDataSourceContextDisposingEventArgs e)
{
e.Cancel = true;
}
System::Object
System::EventArgs
System.ComponentModel::CancelEventArgs
System.Web.UI.WebControls::EntityDataSourceContextDisposingEventArgs
System::EventArgs
System.ComponentModel::CancelEventArgs
System.Web.UI.WebControls::EntityDataSourceContextDisposingEventArgs
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.
Show: