ASP.NET MVC application view was not found error explanation and solution

How many times have you seen error like this before?


Too many times, I guess. What it means indeed? ASP.NET MVC routing cannot locate to action method associated view. If you analyse error carefully, you will find out that locations where view is searched repeats every time error occurs.

One of ASP.NET MVC conventions are that view accociated for particular action method  is searched in Controller/ActionMethod or Shared/ActionMethod catalogs in project. The purpose of /Shared catalog is to contain views that are reused by more than one controller, action method.

ASP.NET MVC routing mechanism searches for four different types of files:

  • .ascx file extension is an ASP.NET Web User Control file.
  • .aspx file extension is an ASP.NET Web Forms web page (form) file.
  • .cshtml  file extension is ASP.NET MVC Razor view engine file for C# language.
  • .vbhtml file file extension is ASP.NET MVC Razor view engine file for Visual Basic.NET language.

Second time, when you see error like this, I hope you find solution more quickly.

Leave a Reply

Your email address will not be published. Required fields are marked *