ObjectDataSourceStatusEventHandler Delegate

Represents the method that will handle the Selected, Updated, Inserted, and Deleted events of the ObjectDataSource control.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public delegate void ObjectDataSourceStatusEventHandler (
	Object^ sender, 
	ObjectDataSourceStatusEventArgs^ e
)
/** @delegate */
public delegate void ObjectDataSourceStatusEventHandler (
	Object sender, 
	ObjectDataSourceStatusEventArgs e
)
Not applicable.

Parameters

sender

The source of the event, the ObjectDataSource control.

e

An ObjectDataSourceStatusEventArgs that contains the event data.

When you create an ObjectDataSourceStatusEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event handler delegates, see Consuming Events.

The following code example demonstrates how to use an ObjectDataSource control with a business object and a GridView control to delete data. The GridView initially displays a set of all employees, using the method that is specified by the SelectMethod property to retrieve the data from the EmployeeLogic object. Because the AutoGenerateDeleteButton property is set to true, the GridView control automatically displays a Delete button.

If you click the Delete button, the Delete action is performed using the method that is specified by the DeleteMethod property and any parameters that are specified in the DeleteParameters collection.

In this code example, some preprocessing and post-processing steps are also performed. The NorthwindEmployeeDeleting delegate is called to handle the Deleting event before the Delete action is performed, and the NorthwindEmployeeDeleted delegate is called to handle the Deleted event after the Delete action has completed, to perform exception handling. In this example, if a NorthwindDataException is thrown, it is handled by this delegate.

To examine the implementation of the EmployeeLogic middle-tier business object that this code example uses, see the class overview in ObjectDataSourceStatusEventArgs.

No code example is currently available or this language may not be supported.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: