The Error information is contained in the Exception that is thrown, which is
an object. Here is a sample of an Error Handler that I use frequently. The
reference to the "LogError()" method would be whatever you want to do with
your Exception data:
public static void HandleError(Exception e)
{
try
{
StringBuilder strMessage = new StringBuilder(e.Message);
if (e.InnerException != null)
strMessage.Append(Environment.NewLine + "Inner Exception: " +
e.InnerException.Message);
strMessage.Append(Environment.NewLine + "StackTrace: " + Environment.NewLine
+ e.StackTrace);
LogError(strMessage.ToString());
}
catch {}
}
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
"Leo R" <no****@newsgroups.com> wrote in message
news:OU**************@TK2MSFTNGP09.phx.gbl...
Hi all,
If an error occurs in an aspx-page, you can configure the web.config in a
way that the user automatically navigates to a certain page (e.g.
error.aspx).
My question: is it possible to catch the stacktrace of the error in
error.aspx so it can be logged? The error has been catched somewhere in
order to perform the reroute to error.aspx. So where are the
error-details?
Leo R.