Explain the difference between layout and master pages ? (MVC Razor interview questions)
Layout are like master pages in ASP.NET Web form. Master pages give a standard look and feel for Web form views while layout gives standard look and feel or acts like a template for razor views.
How to apply layout to Razor views?
So first we need to create a template file as shown in the below code.
And then apply this template to the view as shown below and display data in those respective sections.
You can go through these 100 MVC interview question with answers from
In case you are new to MVC you can start from the below MVC step by step video