Day by day ASP.NET MVC becomes the popular framework among the developers because of clean code and folder structure.In this first article of ASP.NET MVC articles series we will understand folder structure of ASP.NET MVC application.
MVC And Convention standard
ASP.NET MVC applications, by default, depends heavily on conventions. This allows developers to
avoid having to configure and specify things that can be inferred based on convention by adding code through Scaffolding .
For instance, MVC uses a convention-based directory-naming structure when resolving View templates and this convention allows you to omit the location path when referencing views from within a Controller class.
MVC is designed around some sensible convention-based defaults that can be overridden as needed.
This concept is commonly referred to as "convention over configuration" which popular concepts of Ruby on Rails programming language.
The convention over configuration concept implemented in ASP.NET MVC with the help of following main directories
- Each controller name ends with suffix controller.
- The single view directory can be used for entire application.
- By default all directories (folder) created with name of controller name.
Step 1 : Create MVC Application To Create Folder structure
- "Start", then "All Programs" and select "Microsoft Visual Studio 2015".
- "File", then "New" and click "Project..." then select "ASP.NET Web Application Template", then provide the Project a name as you wish and click on OK .
From preceding example we have learned how the folder structure architectures and use of each folder.
Its not mandatory that you should use above folder structure and naming conventions, You can rename it and follow different folder structure as you wish.
To learn more about MVC basic in terms of to understand preceding folder structure practically please refer following videos series.
MVC Basic Videos.
- How to Create MVC Application Step by Step in Visual Studio 2015
- CRUD Operations In ASP.NET MVC 5 Using Entity Framework
- Return Json Result in ASP.NET MVC 5
- ActionResult in ASP.NET MVC
- Creating an ASP.NET MVC Application
- CRUD Operations In ASP.NET MVC 5 Using ADO.NET
- Convert DataTable To Generic List In ASP.NET MVC .
- How To Pass Stored Procedure Using Dapper.NET In MVC
- Show Confirm Alert Box on ActionLink Click In ASP.NET MVC.
- Convert DataTable To Generic List Using LINQ In ASP.NET MVC.
- How to Change ActionLink Text Color In ASP.NET MVC .
- How to Call Another Controller View Using ActionLink In ASP.NET MVC .
- Convert DataTable To Generic List Using AsEnumerable In ASP.NET MVC .
- How To Pass Generic List Using Dapper In MVC