System.Web Namespace HttpServerUtility Class
Returns the previous exception.
[ VB ]
Public Function GetLastError ( ) As Exception
[ C# ]
public Exception GetLastError ( );
[ C++ ]
public: Exception* GetLastError ( );
[ JScript ]
public function GetLastError ( ) : Exception;
The previous exception that was thrown.
The following example prints a description of the application's last error to the HTTP output stream. It prints "No Errors" if no errors have been encountered.
[ VB ]
Dim LastError As Exception
Dim ErrMessage As String
LastError = Server.GetLastError ( )
If LastError Is Nothing Then
ErrMessage = LastError.Message
Else
ErrMessage = "No Errors"
End If
Response.Write ( "Last Error = " & ErrMessage )
[ C# ]
Exception LastError;
String ErrMessage;
LastError = Server.GetLastError ( );
if ( LastError != null )
ErrMessage = LastError.Message;
else
ErrMessage = "No Errors";
Response.Write ( "Last Error = " + ErrMessage );
HttpServerUtility Members