Continue with the previous share, Today I will shared way install Bootstrap in ASP.NET MVC5, I using Visual Studio 2019
You can see again, The article previous
Setup Bootstrap 3.3.1 trong ASP.NET MVC 5
Click right Project -> Manager NuGet Packages -> you click icon setting configuration, add package source
https://api.nuget.org/v3/index.json
Continue! add package source
You search keyword "bootstrap" after then install
After when you install bootstrap success! you can see bootstrap in project
Okay, install success! you can use bootstrap in Layout file of Views/Shared/_LayoutHome.cshtml directory, note you add css,javascript to file
<link rel="stylesheet" href="~/Content/bootstrap.min.css" />
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
Example:Views/Shared/_LayoutHome.cshtml
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>@ViewBag.Title</title>
<link rel="stylesheet" href="~/Content/bootstrap.min.css" />
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
</head>
<body>
<div>
@RenderBody()
</div>
</body>
</html>
Views/Home/Index.cshtml
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>@ViewBag.title</h2>
<a href="https://hoanguyenit.com" class="btn btn-success">https://hoanguyenit.com</a>
</div>
</div>
</div>
Ok, we install bootstrap in ASP.NET MVC 5 success!!
Top comments (0)