I have an ASP.Net website and I want to use a custom error page. I put the following code in my web.config
<customErrors mode="On" defaultRedirect="~/error.aspx">
<error statusCode="404" redirect="~/error.aspx" />
</customErrors>
The problem is when i go to a URL that does not exist is still uses the 404 error page specified in IIS Manager.
Question: How can I make it use the error.aspx page I have created? Why do the settings in IIS Manager override the web.config?