Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SqlDataSourceView::OnDeleting Method (SqlDataSourceCommandEventArgs^)

 

Raises the Deleting event before the SqlDataSource control attempts a delete operation.

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

protected:
virtual void OnDeleting(
	SqlDataSourceCommandEventArgs^ e
)

Raising an event invokes the event handler through a delegate. For more information, see NIB: Consuming Events.

The OnDeleting method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors:

When overriding the OnDeleting method in a derived class, be sure to call the OnDeleting method for the base class so that registered delegates receive the event.

The following code example demonstrates how to handle the Deleting event, which is raised before a Delete operation occurs. Because this example deletes data from the Northwind database, an OnDeleting handler is added to attempt to back up the database to disk before the delete is performed.

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

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft