I have the following entry in the web.config:
<customErrors mode="RemoteOnly" defaultRedirect="Error.aspx" />
Is there a way in Error.aspx.cs to obtain the error details so I can save to a file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use Server.GetLastError() to get the last Exception object that was raised:
Alternatively you may want to look at handling this in the global.asax file in the Application_Error method rather than your custom error page.
There a few different methods described in this Microsoft support article for custom error handling and reporting