ObjectDataSourceView.ObjectCreating Evento

Definição

Ocorre antes de um objeto ObjectDataSourceView criar uma instância do tipo identificado pela propriedade TypeName.Occurs before the ObjectDataSourceView object creates an instance of the type that is identified by the TypeName property.

public:
 event System::Web::UI::WebControls::ObjectDataSourceObjectEventHandler ^ ObjectCreating;
public event System.Web.UI.WebControls.ObjectDataSourceObjectEventHandler ObjectCreating;
member this.ObjectCreating : System.Web.UI.WebControls.ObjectDataSourceObjectEventHandler 
Public Custom Event ObjectCreating As ObjectDataSourceObjectEventHandler 

Tipo de evento

ObjectDataSourceObjectEventHandler

Comentários

O ObjectDataSource controle chama automaticamente o construtor sem parâmetros de um objeto comercial para criar e fazer uma instância dele usando reflexão.The ObjectDataSource control automatically calls the parameterless constructor of a business object to create and instance of it using reflection. Manipule o ObjectCreating evento para chamar explicitamente outro construtor e para definir a instância do objeto que resulta na ObjectInstance Propriedade do ObjectDataSourceEventArgs objeto associado.Handle the ObjectCreating event to explicitly call another constructor and to set the instance of the object that results to the ObjectInstance property of the associated ObjectDataSourceEventArgs object.

Para obter mais informações sobre como lidar com eventos, consulte manipulando e gerando eventos.For more information about how to handle events, see Handling and Raising Events.

Se o método identificado para executar a operação de dados for static ( Shared em Visual Basic), os ObjectCreating eventos e ObjectCreated nunca serão gerados.If the method that is identified to perform the data operation is static (Shared in Visual Basic), the ObjectCreating and ObjectCreated events are never raised.

Aplica-se a

Confira também