Creating a MVC Layout page
The final step for using Bootstrap 4 in your ASP.NET MVC project is to create a Layout page that will contain all the necessary CSS and JavaScript files in order to include Bootstrap components in your pages. To create a Layout page, follow these steps:
- Add a new sub folder called
Shared
to theViews
folder. - Add a new MVC View Layout Page to the
Shared
folder. The item can be found in the .NET Core | Server-side category of the Add New Item dialog. - Name the file
_Layout.cshtml
and click on the Add button: - With the current project layout, add the following HTML to the
_Layout.cshtml
file:<!DOCTYPE html> <html lang="en"> <head> ...
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.