I want to pass an identifier to a custom error page in ASP.NET MVC.
I have the web.config set up to redirect to an error page when there is an status 500 error. I don't know how to pass an error id from the application code that throws the exception (also sets HTTP Status of 500) back to the error page that is configured.
It's easy if I just used Status 200 and returned a view from the Error method of the controller and did all the logic in there, however the Status code must be 500, so that's not an acceptable solution.
I also do not and will not use session for this. I'd like to use query string or view data.
Not a duplicate. This is about error handling (status code 500) and exceptions. 404 is about Page Not Found