System.Web.UI.WebControls.ObjectDataSourceView.ObjectCreating Event

Occurs before the System.Web.UI.WebControls.ObjectDataSourceView object creates an instance of the type that is identified by the ObjectDataSourceView.TypeName property.

Syntax

public event ObjectDataSourceObjectEventHandler ObjectCreating

Remarks

The System.Web.UI.WebControls.ObjectDataSource control automatically calls the default constructor of a business object to create and instance of it using reflection. Handle the ObjectDataSourceView.ObjectCreating event to explicitly call another constructor and to 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.

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

Requirements

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