Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

EntityDataSourceContextDisposingEventArgs Class

Provides data for the ContextDisposing event.

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

public class EntityDataSourceContextDisposingEventArgs : CancelEventArgs

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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:
© 2015 Microsoft