How to show more error message?

A

ad

I use these setting in Web.Config
<customErrors mode="On"
defaultRedirect="~/ErrorPage/GenericErrorPage.aspx">
<error statusCode="403" redirect="~/ErrorPage/NoAccess.aspx"/>
<error statusCode="404" redirect="~/ErrorPage/NotFound.aspx"/>
<error statusCode="500" redirect="~/ErrorPage/InternalError.aspx"/>
</customErrors>

The error of Code 403 and 404 is clear and it will transfer to a assigned
page.
But when the error StatusCode is 500 or not defined, I want to show
something more detail to user on the errorPage.

I have tried string sMsg = Server.GetLastError().Message in
InternalError.aspx and GenericErrorPage.aspx,
But the GetLastError() always return null.

How can I do?
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top