I started with MVC project.
and got stuck up with this thing.
Is it possible to have mvc View directly Inside Views Folder.
Why does it always search inside
Views/Home/Home.cshtml or
Views/Shared/Home.cshtml
My view name is Home.cshtml
Cant i have it directly as Views/Home.cshtml?
The default web view engine is setup to look for views based on the controller they are being rendered from i.e.
Views/{Controller}/View.cshtmland then subsequentlyViews/Shared/View.cshtmlfor views which are shared across multiple controllers.Yes you can, all you need to do is give the full path to where your view is e.g
However, I don’t really see why you would want to. MVC keeps your views tidy & makes it easy to see which views are rendered by which controllers.