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

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

Syntax

public event ObjectDataSourceObjectEventHandler ObjectCreating

Remarks

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.

Requirements

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