2

My apologies in advance if this is a very basic question.

I have download a bootstrap library from internet that has 3 sets of files i.e. css, fonts and js. I have created a MVC 4 application in visual studio 2013. I want to make use of this library in my application. What are different ways I can use this in my application?

P.S: Here is the link from where I got the library.

and I tried adding the below link in _Layout file

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> 

and I added below in my View page.

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

So all started working fine. But I am wondering whether that is the correct way or not and what are other ways possible (e.g. I want to use this in my entire application instead of just one file). Also, is this getting downloaded from the link or how is it getting attached to my application?

WAQ
  • 2,556
  • 6
  • 45
  • 86
  • @ZaheerUlHassan i have them downloaded. I want to know what are different ways to reference them in application – WAQ Apr 12 '17 at 07:13

1 Answers1

2

I think the easiest way is to use NuGet. And after installation you can just drag and drop bootstrap.css file to layout head section. Link will looks like that:

<link href="~/Content/bootstrap.css" rel="stylesheet" />
daniell89
  • 1,832
  • 16
  • 28