we use ASP.NET MVC 4 and i update our project to use jQuery 1.9.0 from jQuery 1.8.3, BUT now Not work client scripts,like jQuery validation,jquery unobtrusive ajax and 3rd party jQuery library and etc!
According to http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released we must use jQuery Migrate Plugin .we use Bundling in our MVC project,but when i use this plugin, jQuery.migrateWarnings not available in console!
My Question:
how we must update jQuery 1.8.3 to jQuery 1.9.0 without any problem in ASP.NET MVC 4 with Bundling enabled?
Run your application and from your browser view the application's source - is the version of jQuery 1.9.0 or 1.8.3?
In Visual Studio, if you go to Tools -> Library Package Manager -> Manage Nuget Packages for Solution... then on the left click updates and you should see jQuery listed - click update.
As far as I know, this will look after everything. Check the source again.
One other thing you can do: go to Solution Explorer -> App_Start -> BundleConfig.cs - make sure the first bundles.Add
call is like this:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-migrate-1.0.0.js"));
EDIT:
Read this.
Look at new bundle code - obviously be sure you have downloaded the migrate file.
You should using Nuget to update. Tools -> Library Package Manager -> Manage Nuget Packages Solution (stop debug mode if you in there)
- when update jquery, you need update other js lib also like
+ Jquery Validate
+ Microsoft Jquery Unobtrusive Validate
+ Other lib if you think it relate..
and in _layout.cshtml Make sure you have something like
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/jqueryui")
if you use ajax validate and jqueryui...
只需在nuget
包管理器中打开包管理器控制台并运行命令:
Install-package jQuery
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.