- Exception Handling
- MVC Framework - Bundling
- MVC Framework - Ajax Support
- Advanced Example
- MVC Framework - Action Filters
- MVC Framework - Routing Engine
- MVC Framework - Layouts
- MVC Framework - Views
- MVC Framework - Controllers
- MVC Framework - Models
- MVC Framework - Folders
- MVC Framework - First Application
- MVC Framework - ASP.NET Forms
- MVC Framework - Architecture
- MVC Framework - Introduction
- MVC Framework - Home
MVC Framework Useful Resources
- MVC Framework - Discussion
- MVC Framework - Resources
- MVC Framework - Quick Guide
- Questions & Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MVC Framework - Folders
Now that we have already created a sample MVC apppcation, let us understand the folder structure of an MVC project. We will create new a MVC project to learn this.
In your Visual Studio, open File → New → Project and select ASP.NET MVC Apppcation. Name it as MVCFolderDemo.
Cpck OK. In the next window, select Internet Apppcation as the Project Template and cpck OK.
This will create a sample MVC apppcation as shown in the following screenshot.
Note − Files present in this project are coming out of the default template that we have selected. These may change spghtly as per different versions.
Controllers Folder
This folder will contain all the Controller classes. MVC requires the name of all the controller files to end with Controller.
In our example, the Controllers folder contains two class files: AccountController and HomeController.
Models Folder
This folder will contain all the Model classes, which are used to work on apppcation data.
In our example, the Models folder contains AccountModels. You can open and look at the code in this file to see how the data model is created for managing accounts in our example.
Views Folder
This folder stores the HTML files related to apppcation display and user interface. It contains one folder for each controller.
In our example, you will see three sub-folders under Views, namely Account, Home and Shared which contains html files specific to that view area.
App_Start Folder
This folder contains all the files which are needed during the apppcation load.
For e.g., the RouteConfig file is used to route the incoming URL to the correct Controller and Action.
Content Folder
This folder contains all the static files, such as css, images, icons, etc.
The Site.css file inside this folder is the default stypng that the apppcation apppes.
Scripts Folder
This folder stores all the JS files in the project. By default, Visual Studio adds MVC, jQuery and other standard JS pbraries.
Advertisements