ASP.NET MVC Folders
-- What you learn is not only technology, but also dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
ASP.NET Tutorial
ASP.NET TutorialASP.NET Introduction
WP Tutorial
WebPages IntroductionWebPages RazorWebPages LayoutWebPages FoldersWebPages GlobalWebPages FormsWebPages ObjectsWebPages FilesWebPages HelpersWebPages WebGridWebPages ChartsWebPages EmailWebPages PHPWebPages PublishingWebPages Examples
WP Reference Manual
WebPages ClassesWebPages SecurityWebPages DatabaseWebPages MailWebPages Helpers
ASP.NET Razor
Razor IntroductionRazor SyntaxRazor C# VariablesRazor C# LoopsRazor C# LogicRazor VB VariablesRazor VB LoopsRazor VB Logic
ASP.NET MVC
MVC IntroductionMVC ApplicationMVC FoldersMVC LayoutMVC ControllersMVC ViewsMVC DatabaseMVC ModelsMVC SecurityMVC HTML HelpersMVC PublishingMVC Reference Manual
WF Tutorial
WebForms IntroductionWebForms PagesWebForms ControlsWebForms EventsWebForms FormsWebForms ViewStateWebForms TextBoxWebForms ButtonWebForms Data BindingWebForms ArrayListWebForms HashtableWebForms SortedListWebForms XML FilesWebForms RepeaterWebForms DataListWebForms Database ConnectionWebForms Master PagesWebForms NavigationWebForms Examples
WF Reference Manual
WebForms HTMLWebForms ControlsWebForms Validation
ASP.NET MVC - Application Folders
To learn ASP.NET MVC, we will build an Internet application.
Part 2: Exploring the application folders.
MVC Folders
The folder contents of a typical ASP.NET MVC Web application are as follows:
Application Information Properties References Application Folders App_Data folder Content folder Controllers folder Models folder Scripts folder Views folder Configuration Files Global.asax packages.config Web.config
All MVC applications have the same folder names. The MVC framework is based on default naming. Controllers are written in the Controllers folder, views in the Views folder, and models in the Models folder. You do not need to use the folder names in the application code.
Standardized naming reduces code volume and helps developers understand MVC projects.
Here is a brief overview of the contents of each folder:
App_Data Folder
The App_Data folder is used to store application data.
We will cover adding a SQL database to the App_Data folder in later chapters of this tutorial.
Content Folder
The Content folder is used to store static files, such as style sheets (CSS files), icons, and images.
Visual Web Developer automatically adds a themes folder to the Content folder. The themes folder stores jQuery styles and images. In the project, you can delete this themes folder.
Visual Web Developer also adds a standard style sheet file to the project: the Site.css file in the content folder. This style sheet file is the one you need to edit when you want to change the application's styles.
We will edit this style sheet file (Site.css) in the next chapter of this tutorial.
Controllers Folder
The Controllers folder contains controller classes that are responsible for handling user input and responses.
MVC requires all controller file names to end with "Controller".
Visual Web Developer has already created a Home controller (for the Home page and About page) and an Account controller (for the Login page):
We will create more controllers in later chapters of this tutorial.
Models Folder
The Models folder contains classes that represent the application's models. Models control and manipulate the application's data.
We will create models (classes) in later chapters of this tutorial.
Views Folder
The Views folder is used to store HTML files (user interface) related to the application's display.
The Views folder contains a folder for each corresponding controller.
In the Views folder, Visual Web Developer has created an Account folder, a Home folder, and a Shared folder.
The Account folder contains pages for user account registration and login.
The Home folder is used to store application pages such as the home page and about page.
The Shared folder is used to store views shared between controllers (master pages and layout pages).
We will edit these layout files in the next chapter of this tutorial.
Scripts Folder
The Scripts folder stores the application's JavaScript files.
By default, Visual Web Developer stores standard MVC, Ajax, and jQuery files in this folder:
Note: The file named "modernizr" is a JavaScript file used to support HTML5 and CSS3 in the application.
Click to Share Notes
Write notes...
Image URL
Image Description
Image Dimensions ΓRestore
Share Notes
- Nickname Nickname (required)
- Email Email (required)
- Reference URL Reference URL
YouTip