Javatpoint Logo
Javatpoint Logo

ASP.NET MVC Bootstrap

Bootstrap is a popular web framework which is used to create responsive web application that can run even on the mobile device. It provides HTML, CSS and JavaScript libraries to build applications.

ASP.NET MVC, by default supports Bootstrap and use it's libraries to create frontend of the application. Let?s create a MVC project and examine its libraries.

First create a project by selecting from the file menu.

ASP Bootstrap 1

Select the type of web project.

ASP Bootstrap 2

Select template for the web application. We are selecting MVC.

ASP Bootstrap 3

After clicking ok, it will create a project that has following structure.

ASP Bootstrap 4

The Script folder of the project includes the Bootstrap JavaScript libraries. Our project includes the following JavaScript files.

ASP Bootstrap 5

The Content folder contains Bootstrap CSS files. Our project contains the following files.

ASP Bootstrap 6

To see the uses of these CSS classes, click on the login link at top right corner of the web page. This will redirect to the login page that has a form to be filled. This form contains HTML components that are organized in a layout with the help of CSS classes.

Take a closer look at the source code of the Login.cshtml file. This file uses CSS classes like row, col-md-8 etc.

// Login.cshtml

If we look at the view source of the Login.cshtml page, it shows that the Bootstrap libraries are linked to the web page. The following two screenshots shows that.

ASP Bootstrap 7
ASP Bootstrap 8




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA