Book Image

Bootstrap for ASP.NET MVC - Second Edition

By : Pieter van der Westhuizen
Book Image

Bootstrap for ASP.NET MVC - Second Edition

By: Pieter van der Westhuizen

Overview of this book

One of the leading open source frontend frameworks, Bootstrap has undergone a significant change and introduced several features that make designing compelling, next-generation UIs much simpler. Integrating Bootstrap with ASP.NET's powerful components can further enhance its capabilities. This book guides you through the process of creating an ASP.NET MVC website from scratch using Bootstrap. After a primer on the fundamentals of Bootstrap, you will learn your way around and create a new ASP.NET MVC project in Visual Studio. You will move on to learn about the various Bootstrap components as well as techniques to include them in your own projects. The book includes practical examples to show you how to use open-source plugins with Bootstrap and ASP.NET MVC and guides you through building an ASP.NET MVC website using Bootstrap, utilizing layout and user-interface components. At the end of this book, you will find some valuable tips and tricks to help you get the most out of your Bootstrap-integrated and ASP.NET MVC-integrated website.
Table of Contents (15 chapters)
Bootstrap for ASP.NET MVC Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

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 and click on Add.

  6. Open the index.html file in the Bootstrap 4 Admin Dashboard template source files and copy its contents to the _Layout.cshtml file.

  7. Change the <head> tag to reference the styles.css folder in the correct folder, as illustrated...