Page-level error handling : Exception « Development « ASP.NET Tutorial






Protected Overrides Sub OnError(ByVal e As System.EventArgs)
    Dim AnError As System.Exception = Server.GetLastError()
    If (TypeOf AnError.GetBaseException() Is SomeSpecificException) Then
        Response.Write("Something bad happened!")
        Response.StatusCode = 200
        Server.ClearError()
        Response.End()
    End If
End Sub








9.18.Exception
9.18.1.What is going to happen if there is no exception handler
9.18.2.Divide By Zero With Exception
9.18.3.Catch exception and display exception message, Source and StackTrace (C#)
9.18.4.Page-level error handling
9.18.5.Application-level error handling
9.18.6.Try to catch error when converting text value to number
9.18.7.Use Global.asax to log application level exception
9.18.8.Generic error handler page
9.18.9.Transfer to different page based on exception type