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

R

ravescar

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top