Error handling in Classic ASP was not the best. ASP.NET has a new error handling mechanism which was already in other languages such as C, C++ and JAVA. It is called the try...catch mechanism, which is also known as "Exception Handling".
This article provides insight about exception handling on the basis of ASP.NET and C# as code behind.