You create a handler for the ContextDisposing event to perform clean-up that is specific to the data context object before the object is destroyed. The LinqDataSourceDisposeEventArgs object contains the data context object that is used when you are selecting, updating, inserting, or deleting data. The ContextDisposing event is raised during the Unload event before the LinqDataSource control disposes the context object.