As you know, MVC is a three-layer architecture.
A model is data objects. You need to save or show data.
Views are the level of html or presentation that will be displayed to users.
The controller is the code underlying the file, all of your code will be in the controller. It receives data from models and applies business logic, and then goes to views to display or get updated data from a view and go to models, and then save it to the database.
File
_layout.cshtml is present on the path ~/Views/Shared/_Layout.cshtml . This is the master page in mvc. You will see that your partial views contain
Layout = "~/Views/Shared/_Layout.cshtml";
this line at the top of the page. You can change the main page for any kind, and you can have several layouts.
The layout contains many partial views, such as left navigation, top navigation, and content. each of which can be configured from the controller.
Here are some links that may help you:
source share