System.Web.UI.WebControls.ObjectDataSource.Selecting Event

Occurs before a ObjectDataSource.Select operation.


public event ObjectDataSourceSelectingEventHandler Selecting


Handle the ObjectDataSource.Selecting event to perform additional initialization that is specific to your application, to validate the values of parameters, or to change the parameter values before the System.Web.UI.WebControls.ObjectDataSource control performs the data retrieval operation. The parameters are available as an IDictionary collection that is accessed by the ObjectDataSourceMethodEventArgs.InputParameters property, which is exposed by the System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs object.

This event can be fired twice for a single call to the ObjectDataSource.Select method, if the ObjectDataSource.SelectCountMethod property is set. The ObjectDataSourceSelectingEventArgs.ExecutingSelectCount property of the System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs object is used to determine if select was called to retrieve data or retrieve the count.

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