Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 ContextCreated Event

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
LinqDataSource..::.ContextCreated Event

Occurs after an instance of the context type object is created.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
Visual Basic (Declaration)
Public Event ContextCreated As EventHandler(Of LinqDataSourceStatusEventArgs)
Visual Basic (Usage)
Dim instance As LinqDataSource
Dim handler As EventHandler(Of LinqDataSourceStatusEventArgs)

AddHandler instance.ContextCreated, handler
C#
public event EventHandler<LinqDataSourceStatusEventArgs> ContextCreated
Visual C++
public:
 event EventHandler<LinqDataSourceStatusEventArgs^>^ ContextCreated {
    void add (EventHandler<LinqDataSourceStatusEventArgs^>^ value);
    void remove (EventHandler<LinqDataSourceStatusEventArgs^>^ value);
}
JScript
JScript does not support events.
ASP.NET
<asp:LinqDataSource OnContextCreated="EventHandler" />

Handle the ContextCreated event to examine the context type object or examine exceptions that are raised while the object is being created. You retrieve the context type object from the Result property of the LinqDataSourceStatusEventArgs object that is associated with this event. You retrieve the exception that was raised during the data operation from the Exception property.

The context type object is created during select, update, insert, and delete operations and is reused throughout the request.

There is one time when the event is not raised. This is when you programmatically set the Result property to an object during the Selecting event. An additional condition is that either the original values do not have to be stored in view state, or the object in the Result property implements the ITable interface.

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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker