0

In my web.config I have the following:

<customErrors mode="RemoteOnly" defaultRedirect="/error.aspx"/>

When an error occurs, the user is redirected to /error.aspx?aspxerrorpath=/somepage where I can get user's name, name of the page, date, but... I can't get the error message!

I can get it via the OnException method, but then I won't be able to get the name of the page which is very important for me.

How can I get both the page and the error message?

2 Answers 2

1

I would suggest you to use
"ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment"

http://code.google.com/p/elmah/

Sign up to request clarification or add additional context in comments.

Comments

0

I solved by using Application_Error method.

More info here:

http://aspnetresources.com/articles/CustomErrorPages.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.