Here is what I have...
in global.asax.cs
protected void Application_Error(Object sender, EventArgs e)
{
Message.LastException = Server.GetLastError().GetBaseException();
string message = "whatever you want to put in here, such as pageurl,
lastexception.message etc.";
}
in your web.config
change the customErrors line to be...
<customErrors mode="On" defaultRedirect="errorpage.aspx" />
in your errorpage...
if (Message.LastException != null)
{
Response.Write(Message.LastException.Message.ToStr ing());
}
You can then display a friendly error message and send the message to
yourself in email.
Actually, looking at this, I don't know why I have string message=... in my
global.asax.cs.
Regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Portal franchises available
"Samuel Shulman" wrote:
Hi all
I would like to implement a Global Error Handler for the following reasons
1. Redirect all users to that page so they will not be lost
2. Learn of the error and fix it...
Somthing similar to the one used in VB applications
Thank you,
Samuel