Folder Structure in Asp.Net MVC Project (Application)

  Total Views : 4781
  Comments : 2
 
  Keywords : MVC folder structure in asp.net, understand the structure of asp.net mvc project or application, Asp.net mvc folder structure best practices

Model - view - controller (MVC) is a software architectural pattern which comes with Model, Controller and View Folder in it. Each folder has different meaning in it. Here we will learn complete folder structure of asp.net mvc project or applicaiton in detailed manner

Model Folder

The model folder represents the data your application will work with. These classes are mostly use for accessing database for performing various DML Operations. 

Controller Folder

The Controller folder contains all Controllers in it and if you closely observe names of controllers you will find that every controller ends suffix with “Controller” name in it. It's name convention for controllers which we need to follow in asp.net mvc.

 

e.g. If we have Controller with name MobileController and Model with same name Mobile then there will be Type clash (in case if we use same "Mobile" as controller name) for that reason we need to write Controller in suffix.

View Folder

The View folder contains all application Views in it. If we look into this folder it contains Folder with name of Controller and inside that it will have views related to that controller in it. If we just expand View folder we will see that it has a subfolder inside it with name Shared it will have all view which are shared among controller init.

 

This kind of convention will help us to reduce time of development and help for maintenance. If you check following image you will understand model, view and controller folders clearly.

 

Model, view, controller folder structure in asp.net mvc

Scripts Folder

Scripts folder will contains all JavaScript files in it. It also has some jQuery validation files in it check following image for scripts folder structure

 

scripts folder structure in asp.net mvc project or application

App_Data Folder

The use for App_Data is to store database related file. Usually SQL Server Express .mdf files and our App_data folder will be like as shown following

 

App_data folder in asp.net mvc project or application

Content Folder

The content folder will contain all styles sheets and images inside it. Our content folder will be like as shown following image

 

content folder in asp.net mvc project or application

 

If we follow all these folder structures while creating application it's easy for us to maintain project easily while it's growing.

 Comments (2)

  • vasu tutlane registered profile image
     
    vasu   Reply

    Thanks Sir, but i want the detailes of the folder App_Start Please provide it if possible to me

     Jan 21, 2016
  • shiv tutlane registered profile image
     
    shiv   Reply

    HI good technical resource for beginner and Advance. Thanks

     Feb 11, 2016

Leave a comment

  • Default Tutlane User