ASP.NET MVC Folder Structure
In the previous tutorial, we took a bold step of creating our first MVC application. Congratulations on that. In this section, we will explore the file structure which Visual Studio gave us by default.
A typical ASP.NET MVC application has the file structure as shown in the figure below:
We will take a quick look at the significant and functions of the folders and files present the ASP.NET MVC application.
The App_Data folder is empty by default at the point of creating the application. This folder contain certain data files like LocalDB, xml files and .mdf files. Other data related files can also be kept in this folder.
Just like the name, it contains files which will be executed once the application starts. These are some configuration files like BundleConfig.cs, FilterConfig.cs, IdentityConfig RouteConfig.cs and Startup.Auth.cs files
The content folder contains static files like CSS, Icons and image files. By default, ASP.NET comes with bootstrap and some other stylings to get us started.
The folder contains C# classes that handles the requests made on this application and returns the appropriate response. By default, MVC requires us to end our controller classes with the suffix "Controller". We will discuss more on this in the subsequent chapters.
The fonts folder contains custom font files for your application.
The Models folder contains our application model classes. Theses are classes that will be used to control and manipulate our application data.
This folder contains our migration files, which are a snapshot of our model classes. The migrations files are used in creating our database off our model classes.
The view houses the html files of our application. The files found in the view folder usually ends with the. cshtml extension, this enables us to write C# codes in this files.
In the view folder, the view files are arranged into different controller folders. For instance, all the files controlled by the AboutController will be in the View>About folder.
The Shared folder houses views that can be shared amongst the different controllers.
The ASP.NET MVC applications also come bundled with some configuration files, which we will take a quick look at.
This contains some high level configurations that will determine the overall behavior of our application. In the global.asax, application level events are configured.
Packages.config file is managed by NuGet to keep track of what packages and versions you have installed in the application. This is similar to package.json file in Node.js applications.
The Web.config file contains application level configurations and settings, like the db connection strings etc.
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework