the enterpriselibrary.logging (.database) is an option
log4net is another.
I define one class with a static method that I encapsulate what I need
(logging, etc).
then either the use can get the error, or do a redirect.
If the exception is a unique constraint issue (SSN for example), then
showing them the issue on the same page is good I think.
If its a db is gone type error, then a redirect to a page is good.
public class ThisApplicationExceptionThinger
public static LogException (Page p , Exception ex , bool redirect )
{
//do something with the error, like the EnterpriseLibrary.Logging
if(redirect)
{
p.Response.Redirect("~/showexceptiontouser.aspx");
}
}
Something like that.
You can either querystring the msg or put it in the Session temporary.
"Billy" <Bi***@discussions.microsoft.comwrote in message
news:C8**********************************@microsof t.com...
asp.net 2.0 vs2005
What is best practice for exception handling on a website in vs2005?
I was going to catch errors in application on_error event, log them to the
event log, then send users to an error page. But looking at the event log,
asp.net 2.0 logs those errors anyways, with more detail than i cen get
from
the exception object. So is there any point logging them to the event log,
is
it jsut better to let .net do this and get the more information, and jsut
have the 0n_error event handler re-direct to the custom error page?
Jsut wondering what other people do?