System.Web.UI.WebControls.ObjectDataSource.ObjectCreating Event

Occurs before the object that is identified by the ObjectDataSource.TypeName property is created.


public event ObjectDataSourceObjectEventHandler ObjectCreating


If the method that is identified to perform the data operation is static (Shared in Visual Basic), the ObjectDataSource.ObjectCreating and ObjectDataSource.ObjectCreated events are never raised.

The System.Web.UI.WebControls.ObjectDataSource control automatically calls the default constructor of a business object to create an instance of it using reflection. Handle the ObjectDataSource.ObjectCreating event to explicitly call another constructor, and set the instance of the object that results to the ObjectDataSourceEventArgs.ObjectInstance property of the associated System.Web.UI.WebControls.ObjectDataSourceEventArgs object.

For more information about handling events, see Consuming Events.


Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0