one custom error page that handles all exceptions

F

feng

I want to have a custom error page that I can always call
and pass parameters to it when I hit runtime exceptions.
For instance, in my code behind, I have a try-catch block.
When I catch an exception, the exception object contains a
collection of messages to be displaied. I would like to be
able to call a common exception handling page and somehow
pass along the exception collection. Then the exception
page will retrive the messages from the collection and
display it to the user's browser.

Could someone tell me how to achieve this? Some sample
code would be even better.

Thanks a million.

Feng
 
C

Curt_C [MVP]

Just an idea but.....
throw it (the error) to a session item, then in your webconfig specify the
page, in the customErrors tag, and have this page look in the session for a
value?
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top