C#C
C#3y ago
Krautzer

❔ MVC Error Handling

Hello, I am purposely getting a 403 error to test whether customErros is working. But the page I showed in custom erros does not appear. Instead, the page in the picture appears.
<customErrors mode="On" defaultRedirect="/Error/Error">
            <error statusCode="404" redirect="/Error/NotFound"/>
            <error statusCode="500" redirect="/Error/ServerError"/>
            <error statusCode="403" redirect="/Error/NotFound"/>
        </customErrors>

[HttpGet]
        public ActionResult Login()
        {
            return new HttpStatusCodeResult(403);

Do I need to see the Error/Not Found page?
Ekran_goruntusu_2023-10-01_175359.png
Was this page helpful?