Get details error msg through email

Posted by Venkat | Labels:

Here we discuss how to get the html errormessage ie: yellow asp.net error message ie: show on stack trace if any error occurs in our project so we have to pass this msg to user through email.

we just get that Asp.net yellow error msg

this is the code

Exception err = Server.GetLastError();
Response.Clear();
HttpUnhandledException httpUnhEx = err as HttpUnhandledException;
if (httpUnhEx != null)
{
Response.Write("<h1>ASP.NET Error Page:
\n"+ httpUnhEx.GetHtmlErrorMessage());
}

0 comments:

Post a Comment

Thanks for the Comments.

PayOffers.in