One of ASP.NET MVC errors wasted one hour of my life today (of course, it is many times less than this season’s leader SharePoint) but this is still one hour. “The view ‘Index’ or its master could not be found. The following locations were searched” error raised suddenly and I was not able to get over it. Well, this time solution was simple.
The error was:
The view ‘Index’ or its master could not be found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
It tells about page requested but doesn’t mention exactly what is missing. In my case it was one MvcUserControl that was missing. After inserting correct name for it the error disappeared and everything worked again.
View Comments (6)
Any hints?
I'm trying to walk through NerdDinner (chapter 1 from Professional ASP.NET MVC 1.0), and frustrated by this error.
I know this is a weird error. Does come for various reasons.
Your article isn't very helpful.
"In my case it was one MvcUserControl that was missing. After inserting correct name for it the error disappeared and everything worked again."
Thanks.
I fixed this error by changing the Index method from
return View(_db.MovieSet.ToString());
to
ViewData.Model = _db.MovieSet
any one of your included file is not in place
In web.config,remove attributes of "pages"