MVC 6 Jquery reference after adding via Nuget

I created a new MVC 6 project, an empty template. Added by jQuery via NuGet. How do you refer to it then in your _Layout file or where you want to use it. I do not have a script folder with jQuery.

<head> <meta name="viewport" content="width=device-width" /> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="~/css/site.css" /> <script src=""></script> -- HERE <title>@ViewBag.Title</title> </head> <body> <div> @RenderBody() </div> @RenderSection("scripts", required: false) </body> </html> 

Project soultion

+3
source share
1 answer

Remove the package from Nuget and add through the gazebo. If you created a new empty MVC 6. project, you will need to add the bower.json file, and then add the jQuery dependency

 { "name": "ASP.NET", "private": true, "dependencies": { "jquery": "2.1.4" } } 

Then in your layout add a link

 <script src="~/lib/jquery/dist/jquery.js"></script> 
+2
source

All Articles