ASP.NET MVC Application Folder Structure
January, 2019 / by Krishan Dutt Sharma
In This Article we learn, How to Create a demo MVC Project using Visual Studio 2013 Community Edition. So, Friends lets Start with the creation of new Project.
Create New Project in Visual Studio 2013 which we learn our previous article “Create A New ASP.NET MVC Project In Visual Studio 2013”
ASP.NET MVC Folder Structure
It is very important to Know about the folder Structure of asp.net MVC. It will help you to add files to an appropriate folder.
Visual Studio creates the following folder structure of MVC application by default.
- App_Data: In MVC Folder Structure First Folder is App_Data which contains data files like LocalDB, .mdf Files, XML files and other data related files. IIS will never serve files from App_data Folder.
- App_Start: In MVC Folder Structure the second Folder is App_Start which Contains class files which get executed when the application starts. Normally it is config files like BundleConfig.cs, AuthConfig.cs, Filterconfig.cs etc.
- Content: In MVC Folder Structure the third Folder is Content which Contains static files like CSS Files, Images and icons etc. MVC 5 Application include bootstrap.cs bootstrap.min.cs and site.css by default.
- Controllers: In MVC Folder Structure the fouth Folder is Controllers which Contains class files which handle user’s request and response. All the controller file name end with Controller word like EntryController, LoginController etc. You will Learn about the Controller in Next Section.
- Fonts: In MVC Folder Structure the fifth Folder is Fonts which contains custom font files for your application.
- Model: In MVC Folder Structure the sixth Folder is Model which Contains model class file which handles database tasks. Typically model class includes public properties, which will be used by the application to hold and manipulate application data.
- View: In MVC Folder Structure the eighth Folder is View which Contains HTML Files. There May be a Separate folder for each controller. For EntryController.cs; there is Entry Folder inside View Folder. Typically view files is a .cshtml file where you write HTML and c# or VB.net code.
- Shared: In MVC Folder Structure the second ninth is Shared which is under view folder and it contains shared files like master page layout etc. Shared folder content can be accessed by any Controller.
- Global.asax: In MVC Folder Structure the tenth File is Global.asax which allows you to write code that runs in response to application level events, such as Application_BeginRequest, Application_start, Application_error, Session_start, Session_end etc.
- Package.config: In MVC Folder Structure the eleventh file is Package.config which is managed by NuGet to keep track of what packages and versions you have installed in the application.
- Web.config: In MVC Folder Structure the twelfth file is web.config which contains application level configurations.
If I have missed anything, please comment below.