Handling Method Errors

You can handle the Selected, Inserted, Updated, or Deleted events to handle any errors that might result from calling a method. For example, the page in Listing 18.34 handles the Inserting event to capture any errors raised when the method represented by the ObjectDataSource control’s InsertMethod property is called.

Listing 18.34. HandleErrors.aspx

images

images

images

In Listing 18.34, the Inserted event handler checks for an exception. If ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.