Massoud Mazar

Sharing The Knowledge

NAVIGATION - SEARCH

Quick and easy Custom 404 page for ASP.net MVC 5

While ASP.net MVC makes it easy and clean to create a professional looking website, it seems to be a little harder to incorporate custome error pages (e.g. 404 page) which are part of general look and feel of your site. There are many good write-ups on how to do this (for example http://benfoster.io/blog/aspnet-mvc-custom-error-pages), but I was looking for an easy way to point to one of my views as the 404 page.

What I ended up doing was to create a controller for my error views and use the httpErrors section of web.config to point to it: More...