1.4. Other Exception Handling Scenarios
You've already learned how to handle exceptions in your own code. However, ASP.NET has several components that do their work behind the scenes. Since this is code that you don't write yourself, you can't very well stick a try-catch block in there. So, how do you deal with errors that occur in these components? Let's take a look at a few common scenarios.
1.4.1. Handling Exceptions in ASP.NET Data Sources
As you know, you can use data source controls to bind ASP.NET server controls to data. When you do that, the methods that do the actual work are invoked automatically by the data source control. For example, the business object method specified in the SelectMethod property of an ObjectDataSource is invoked ...
Get Robust ASP.NET Exception Handling 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.