This documentation is archived and is not being maintained.

LinqDataSourceStatusEventArgs::ExceptionHandled Property

Gets or sets a value that indicates whether the exception was handled and that it should not be thrown again.

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

public:
property bool ExceptionHandled {
	bool get ();
	void set (bool value);
}

Property Value

Type: System::Boolean
true if the exception was handled; otherwise, false.

You can create event handlers for the ContextCreated, Deleted, Inserted, Selected, and Updated events to examine any exceptions that occurred during those operations. If you handle the exception and do not want it to be thrown again, set the ExceptionHandled property to true. If you do not set the ExceptionHandled property to true, the exception will be propagated to the next event handler in the call stack.

The following example shows an event handler for the Inserted event. In the event handler, if the Exception property is nullptr, the product ID is retrieved from the object in the Result property. The product ID is a primary key for the table and is set by the database, therefore the value is not known until the insert operation has finished. The exception message is logged if the Exception property is not equal to nullptr. The ExceptionHandled property is then set to true.

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Show: