简体   繁体   English

“jquery.unobtrusive-ajax.js”过时了吗?

[英]Is “jquery.unobtrusive-ajax.js” obsolete?

I have an ancient MVC2 solution that I migrated to MVC5 (Visual Studio 2013). 我有一个古老的MVC2解决方案,我迁移到MVC5 (Visual Studio 2013)。

I'd like to update the old libraries used in the project with the new ones. 我想用新的库更新项目中使用的旧库。

I have by eg. 我有例如。 the jquery.unobtrusive-ajax.js library. jquery.unobtrusive-ajax.js库。 Is it obsolete as by now? 它现在已经过时了吗?

I ask because that library references 我问,因为该库参考

/// <reference path="jquery-1.4.4.js" />

but I upgraded the jQuery (I use the jQuery v1.8.3 by now). 但我升级了jQuery(我现在使用jQuery v1.8.3)。

If it with what to replace (like jquery.validate.unobtrusive.js (?)) 如果它有什么替换(如jquery.validate.unobtrusive.js (?))

PS. PS。
In a default MVC project Visual Studio 2013 proposes the folowing "validation" scripts: 在默认的MVC项目中,Visual Studio 2013提出了以下“验证”脚本:

jquery.validate-vsdoc.js
jquery.validate.js
jquery.validate.min.js
jquery.validate.unobtrusive.js
jquery.validate.unobtrusive.min.js

jquery.unobtrusive-ajax.js is a Microsoft library for supporting @Ajax.* helpers, this is a plugin that unobtrusively sets up jQuery Ajax . jquery.unobtrusive-ajax.js是一个支持@Ajax.*帮助程序的Microsoft库,这是一个不引人注意地设置jQuery Ajax的插件。

If you use @Ajax helpers in your code, like ActionLink or BeginForm , along with updating jQuery you have to update the Microsoft jQuery Unobtrusive Ajax , otherwise you can remove it. 如果在代码中使用@Ajax助手,比如ActionLinkBeginForm ,并且更新jQuery ,则必须更新Microsoft jQuery Unobtrusive Ajax ,否则可以将其删除。

If you remove reference to the jquery.unobtrusive-ajax.js , @Ajax helpers will be working as regular @Html helpers. 如果删除对jquery.unobtrusive-ajax.js引用, @Ajax帮助程序将作为常规@Html帮助程序工作。

How can I know if I still use them? 我怎么知道我是否还在使用它们?

Try to look for the usages of these methods. 尝试寻找这些方法的用法。

You were asking how you can make sure whether you have the latest jquery-unobtrusive-ajax.js installed (or how to check whether it may be obsolete). 您在询问如何确定是否安装了最新的jquery-unobtrusive-ajax.js(或者如何检查它是否已过时)。

Visual Studio 2010+ comes with the NuGet package manager console (PMC). Visual Studio 2010+附带NuGet包管理器控制台(PMC)。 To see if your project's external references (like, eg, unobtrusive AJAX) are still up to date: 要查看项目的外部引用(例如,不引人注目的AJAX)是否仍然是最新的:

  1. Open your project in Visual Studio 在Visual Studio中打开您的项目
  2. Right-click your project in Solution Explorer 在解决方案资源管理器中右键单击项目
  3. Select "Manage NuGet packages" 选择“管理NuGet包”
  4. Select the package you want to update (unobtrusive AJAX a/o unobtrusive validation) 选择要更新的包(不引人注目的AJAX a / o不显眼验证)
  5. Here you can see whether you're using the latest version of the external reference or if an update is available. 您可以在此处查看是否使用最新版本的外部参考或是否有更新。
  6. Press the [Update] button. 按[更新]按钮。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM