Logging errors in ASP.NET (MVC) through the Custom Error
- by Alex
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?