Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2007

Tip: Looking for answers? Try searching our database.

Relicate default error page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bmjnine@hotmail.com - 17 Sep 2007 23:48 GMT
Hi all,

I'm using Application_Error in Global.asax to send myself an email
when a server error occurs on my site. It's been working fine. However
I just realized that by using this override, the error message no
longer is displayed to the user. So I just want to include some code
to replicate the default error page to the screen.

Is there some sort of "display default server error" method to produce
what you would normally see without custom error handling?

If not, I would like to stick to a similar layout and order when
displaying the source, message, innerexception, stacktrace, etc.
Anyone know what that would be? I always get them mixed up, and would
prefer not to go causing errors on the site to figure it out.

Thanks,
Alyssa
Ben Schwehn - 18 Sep 2007 11:22 GMT
> I'm using Application_Error in Global.asax to send myself an email
> when a server error occurs on my site. It's been working fine. However
> I just realized that by using this override, the error message no
> longer is displayed to the user.

I cannot reproduce this, when I do:

void Application_Error(object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
System.Net.Mail.MailMessage mail = new
[snip creating mail]
smtp.Send(mail);
}

The mail gets send and with customErrors mode="Off", the exception is
still shown with the default error page.

Ben

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.