Explain to me different types of folder structure present in Asp.net MVC with suitable examples and also with an image.
Define different Folder Structure in Asp.Net MVC.
43903-Feb-2020
Updated on 03-Feb-2020
Home / DeveloperSection / Forums / Define different Folder Structure in Asp.Net MVC.
Explain to me different types of folder structure present in Asp.net MVC with suitable examples and also with an image.
Nishi Tiwari
03-Feb-2020Model - view - controller (MVC) is an architectural pattern for the software which comes with Model, Controller and View Folder in it. Each folder has a different meaning within it. Here we will learn about all types of folder structure which are present in asp.net MVC project or application.
Model Folder
The model folder represents the data of our application which will work with it. These classes are mostly used for accessing the database for performing several DML Operations.
Controller Folder
A Controller folder will contain all Controllers in it and if we closely observe names of controllers we will find that every controller ends suffix with the “Controller” name in it. It is a naming convention for controllers that we need to follow in asp.net MVC.
View Folder
A View folder contains all application Views in it. If we look into this folder it contains Folder with the name of Controller and inside this, it will have views related to that controller in it. If we just want to expand View folder we will see that it has a subfolder inside it with name Shared. It will have all views that are shared among controller init.
These kind of convention will help us to reduce the time of development and help for maintenance. If we check the following image we will understand model, view and controller folders clearly.
Scripts Folder
Scripts folder will contain all JavaScript files within it. It also has some jQuery validation files in it here is the following image of the script folder
App_Data Folder
A use for App_Data is to store database-related files. Usually, SQL Server Express .mdf files and your App_data folder will be like as shown below
Content Folder
The content folder will contain all styles sheets and images inside within it. Our content folder will be like as given in the following image
If we follow all these folder structures while creating any application then it will be easy for us to maintain project easily while it will be growing.