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?
<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?