Dealing with Page Errors
Just like other.NET applications, ASP.NET applications can take advantage of exceptions to catch and handle runtime errors that occur in the code. Exceptions, though, should be just what their name suggests—that is, exceptional events in the life of the application, raised when something happens that violates an assumption. A typical bad programming practice is to rely on exceptions to catch any possible error resulting from an operation. Admittedly, wrapping a piece of code with a try/catch block makes programming much simpler while offering a single point of control for errors. However, employing this technique on a large scale can result in a dramatic loss of performance. Exceptions are meant to target exceptional events ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access