MVC6项目中的jQuery-UI脚本存储在哪里? [英] Where are jQuery-UI scripts stored in MVC6 project?

查看:114
本文介绍了MVC6项目中的jQuery-UI脚本存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从MVC6开始,正在尝试使用一些jQuery-UI元素.

I'm starting with MVC6 and I'm trying to use some jQuery-UI elements.

安装软件包后,我找不到jQuery-UI的脚本文件.尽管互联网上的许多教程都说文件应该存储在Scripts文件夹中(例如:<script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")"></script>),但MVC6似乎并非如此.

After installing the package, I cannot find the script files of jQuery-UI. While lot of tutorials on the internet tell that the files should be stored in Scripts folder (for example: <script src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")"></script>), it seems that it isn't the case with MVC6.

我看到了这个问题(如何使JQuery-UI与ASP.NET MVC6一起使用?),其中从jQuery网站:<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>.

I saw this question (How to get JQuery-UI to work with ASP.NET MVC6?) in which the file is retrieved from jQuery site : <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>.

有没有办法像以前那样将文件存储在我们的服务器上?这些文件存储在MVC6项目中的什么位置?

Is there any way to have files stored on our server as before ? Where are these files stored in MVC6 project ?

谢谢.

推荐答案

当我第一次开始使用.NET 5时,我花了很长时间试图弄清楚这一点.不要在.NET 5中使用NuGet安装客户端软件包.请使用Bower.

I spent a long time trying to figure this out when I first started using .NET 5 as well. Don't install client packages with NuGet in .NET 5. Use Bower.

要使用Bower进行安装,请在解决方案资源管理器中的项目中展开"Dependencies"项.您应该在那里看到一个"Bower"文件夹.右键单击它,然后选择管理Bower程序包".在打开的窗口顶部,您可以选择浏览",然后搜索"jquery-ui".它应该显示在下面的列表中,您可以选择它并单击安装按钮.

To install it with Bower, expand the "Dependencies" item in your project in the solution explorer. You should see a "Bower" folder there. Right-click on it and select "Manage Bower Packages". At the top of the window that opens you can choose "Browse" and then search for "jquery-ui". It should show up in the list below and you can select it and click the install button.

一旦安装,您可以在wwwroot/lib/jquery-ui下找到它

Once it's installed, you can find it under wwwroot/lib/jquery-ui

然后,您可以像这样<script src="~/lib/jquery-ui/jquery-ui.js"></script>

-更新-
我现在一直在将NPM用于客户端软件包,但是重点仍然存在.不要将NuGet用于客户端软件包.

--UPDATE--
I've been using NPM now for client packages, but the point still stands. Don't use NuGet for client packages.

这篇关于MVC6项目中的jQuery-UI脚本存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆