Click here to Skip to main content
11,928,403 members (45,723 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


8 bookmarked

How to manage controller/action not found in ASP.NET MVC

, 21 May 2013 CPOL
Rate this:
Please Sign up or sign in to vote.
Manage controller/action not found in ASP.NET MVC


A common error when we developed web sites is that we forget to manage the error 404 (resource not found), so I will show how to manage this problem easily in ASP.NET MVC.

Using the code

First, create a new ASP.NET MVC 4 Project using the basic template, this template looks like:

Basic template MVC 4

Next, add the package NotFound MVC using Nuget:

NotFound MVC Package using Nuget

When the package is installed, you can see that a new view was create at the folder Views/Shared:

NotFound View

Now, if you run the application, automatically you are sent to the NotFound view:

NoFound View Redirect

The next step, is that you personalize the view.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) BDotNet
Colombia Colombia
Microsoft ASP.NET MVP, I love software development, especially web development, I have worked with Microsoft technologies for about five years in the development of large scale enterprise applications, co-creator of several Carreras for the Microsoft Virtual Academy (MVA), speaker at events Microsoft Colombia and member of the Core Group BDotNet community. You can see some of my contributions in

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 22 May 2013
Article Copyright 2013 by julitogtu
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid