How to add jQuery UI to Asp.Net Core VS2017?

Thomas Adrian picture Thomas Adrian · Jan 26, 2018 · Viewed 10.8k times · Source

I have installed jQuery UI using Bower in VS2017.

When I look in Solution Explorer I can see that the Bower package seem to have been installed but I can't find them in the wwwroot folder so I don't know how to add them to the _layout.cshtml file.

What is the procedure for adding jQuery UI to my ASP.NET Core v2 application.

enter image description here

enter image description here

Answer

Volkan picture Volkan · Nov 13, 2018

For ASP .NET Core 2.1 (Visual Studio 15.8 or later),

  1. Click-right on your project of the solution
  2. Choose Manage Client-Side Libraries...
  3. Add the following code (this is like Bower):

code

  { "version": "1.0", "defaultProvider": "cdnjs", "libraries": [ { "library": "[email protected]", "destination": "wwwroot/lib/jquery-ui/" } ] }
  1. Rebuild the project, this will generate all the source for that library in the specified destination
  2. Reference the .js and the .css in your project (_Layout.cshtml)

Source: https://docs.microsoft.com/en-us/aspnet/core/client-side/libman/libman-vs?view=aspnetcore-2.1