Creating the master layout

You've added the CSS and JavaScript files needed to create the master layout file for your project. Next, you need to create a home controller as well as a master layout file. To do this, complete the following steps:

  1. Add a new empty controller called HomeController to the Controllers folder by right-clicking on it and selecting Add | New Item....
  2. Select MVC Controllers Class from the list of project items and click on the Add button.
  3. Next, right-click on the Views folder in your project and navigate to Add | New Folder. Name the folder Shared.
  4. Right-click on the newly created Shared folder and navigate to Add | New Item...
  5. Select MVC View Layout Page in the list of project items and keep the name of the file as _Layout.cshtml ...

Get Bootstrap for ASP.NET MVC - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.