I want to design a general error page which displays different message by HTTP Status error. Is it possible?
<customErrors mode="RemoteOnly" redirect="GenericErrorPage.htm">
For example, if
error statusCode="403"
Then displaying
Access Denied!
Thanks.
Yes, it;s possible, try something like:
However keep in mind that if you are hosting your web application in IIS 7, then you would need to define your custom errors as follows:
Edit 1
If you want to have a generic ASPX error page and display error messages depending on the HTML error status code, you could do the following:
(I just tested and it works)
Add the attribute
redirectMode="ResponseRewrite"to yourcustomErrorssection:In your generic error page (Page_Load event):