C
C#9mo 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>
<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);
[HttpGet]
public ActionResult Login()
{
return new HttpStatusCodeResult(403);
Do I need to see the Error/Not Found page?
No description
1 Reply
Accord
Accord9mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.