ObjectDataSourceStatusEventArgs::ExceptionHandled Property
Gets or sets a value indicating whether an exception that was thrown by the business object has been handled.
Assembly: System.Web (in System.Web.dll)
Property Value
Type: System::Booleantrue if an exception thrown by the business object has been handled and should not be thrown by the ObjectDataSource; otherwise, false.
If the business object throws an exception, the ExceptionHandled property is set to false and the exception is wrapped by the Exception property. If you use an ObjectDataSourceStatusEventHandler object, you can check the Exception property and handle the exception. If you handle the exception, set the ExceptionHandled property to true or the ObjectDataSource control will throw an exception.
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 handle any exceptions that might have occurred. In this example, if a NorthwindDataException is thrown, it is handled by the NorthwindEmployeeDeleted delegate.
To examine the implementation of the EmployeeLogic middle-tier business object that this code example uses, see the class overview in ObjectDataSourceStatusEventArgs.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.