ASP.NET Web application is created with the MVC template and is auto-generated by the Integrated Development Environment of Visual studio. The default folder structure of this framework has specified places where you can place your code classes.
View, Model, and Controller
The model should be in the Model Folder. The Controller must be in the controller folder. The View must be in the View folder. If you put it in the wrong place, your application might not work as you expected.
The advantage of MVC framework is it organizes your code structure. It will divide your project into three different elements and will make it easy for you to navigate where your views are, where your controller and model. It also helps a lot when it comes to debugging.
For further knowledge on how this folder is being used in this framework, let’s go down the line and make an overview of each element and folder in our solution explorer.Note: I’m using Visual Studio 2013
(To create your first MVC Application Refer to this blog post Create your first ASP.NET Application)
ASP.NET MVC Folder Structure
The image below is the folders and files generated for a newly created Visual Studio ASP.NET MVC Web Application project. Let’s see the significance in each file in the solution explorer.
This folder contains application data like the local Database used by the application like .mdf file. This folder doesn’t have a special meaning in the MVC framework.
This folder contains style sheet for your sites like Site.css.
This is the heart of MVC where you can find all the classes that are responsible for the processing of data. The controller is always tied to the View folder.
For example, We have HomeController in the controller folder then we should have a Home folder in the Views folder. If we have AccountController in the controller folder, we should also have Account Folder in the views folder. Home Controller must be named with a Controller at the end in order for it to work.
This folder contains User interface of your application. See image below.
Folder inside Views are the View for the Controller that you created. Please see tables below.
The shared folder contains a template of your Web Application. _layout.cshtml, it’s like a master page and responsible for how all your pages will look like. _LoginPartial.cshtml contains code for partial menu .Error.cshtml is responsible for displaying an error. ViewStart.cshtml it calls the default layout of the page which is _layout.cshtml. Web.config is an app configuration file that contains assemblies needed for the project.
Contains customize font you want to use in your project.
This folder contains classes that are responsible for the identification of data. This is where all application requirements are registered.
Favicon.ico -> default site logo icon
Packages.config -> this comes from nugget packages.
Web.config -> Configuration settings of your application
For additional reference you can visit this link Tutorial Teacher.
Thank you for reading. Hope this helps. Enjoy Coding!!!