void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs // ... // Use HttpContext.Current to get a Web request processing helper HttpServerUtility server = HttpContext.Current.Server; Exception exception = server.GetLastError(); if (exception is HttpUnhandledException || exception is TargetInvocationException) { exception = exception.InnerException; ASPxWebControl.SetCallbackErrorMessage(exception.Message); } // Log an exception logger.Error(exception); // Su dung de hien thi Loi o Trang Error.aspx khi muon hien thi loi o Server Side //AddToShowLog(exception.Message, exception.StackTrace); }