Asp.net 会话级异常

Asp.net 会话级异常,asp.net,Asp.net,我有一页。我需要捕获由于超时而引发的异常 是否有任何异常消息,如System.Applicationexception您可以在Global.asax.cs中使用应用程序错误事件: protected void Application_Error(object sender, EventArgs e) { var exception = Server.GetLastError(); LogException(excep

我有一页。我需要捕获由于超时而引发的异常


是否有任何异常消息,如System.Applicationexception

您可以在Global.asax.cs中使用应用程序错误事件:

    protected void Application_Error(object sender, EventArgs e)
    {
                var exception = Server.GetLastError();
                LogException(exception);
    }
捕获此异常后,请记录此异常,甚至将其发送到邮件:)