17 April 2014

MVC Folder Structure -- MVC

You can see that in the Solution Explorer the Visual Studio has created some files and folders 



Application Folders
  • App_Data: Used for storing application data
  • Content Folder: Used to store files like style sheets, icons and images         


  • Scripts Folder: Used to storing java scripts, by default it contains mvc, Ajax and jquery files          


  • Models Folder: Contains a folder for controller, it is used to store the view (.cshtml) files
         
  • Views Folder: It is contains model class which represent the application models. Models classes are used for data manipulation
          
  • Controller Folder: It contains the controller class which is responsible for handling user input and response


  • Views/Shared:
       The Shared folder is a subfolder of the Views folder. It used for multiple views. It holds global Master Pages, Error Pages and User Controls used by multiple controllers. This folder is not associated with any particular Controller.
       
      


Configuration Files
  • Global.asax: It is optional file .this is where you write logic at application level or define objects with session or application wide scope. For an instance Error handling we can define event handlers in the application scope or session scope

No comments:

Post a Comment