By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,319 Members | 2,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,319 IT Pros & Developers. It's quick & easy.

retrieve string representation of default error page output when handling exception?

P: n/a
I am currently working on an generic error collection mechanism in
ASP.NET2.0 written using C# that can catch unhandled exception on a web
application in application level. it automatically save an html output
with tables containing environmental detail(client browser detail, form
request detail etc) to a predefined Error folder.

we all know that when an exception occurs in a web application, and you
have not set a custom error page in that application, we will see the
default error page, which is quite useful to developer for debugging
purpose.

now the problem is:
Is there any good way for me to retrieve an string representation of
the HTML output of the DEFAULT error page so i can save them as a
separate file, given that all the client can see would be the custom
error page. something like page printing "We are sorry that an error
occured, the error detail is now logged and an email regarding this has
been send to admin"

there is a few page available on net regarding capturing of html output
of Asp.net pages, but that is not really what i wanted, as it need to
be the error page that is rendered to string.

the idea is the mechanism should log in addition to all the other
details, contain an link to that html output of default error page of
that particular error, so developer can click the link and redirected
to see the line causing error, exception messages, stack trace and all
those stuff. The retrieval of default error page is the hard part for
me.

Has anyone else come across the same problem and got a solution?
if anyone can provide a solution, it would help me greatly!

Mar 22 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.