Upgrade jQuery 1.8.3 to jQuery 1.9.0 in ASP.NET MVC 4

we use ASP.NET MVC 4 and update our project to use jQuery 1.9.0 from jQuery 1.8.3, BUT client scripts like jQuery validation, jQuery unobtrusive ajax and third-party jQuery library etc.

According to http://blog.jquery.com/2013/01/15/jquery-1-9-final-jquery-2-0-beta-migrate-final-released we should use jQuery Migrate Plugin .we use Bundling in our MVC project, but when I use this plugin, jQuery.migrateWarnings are not available in the console!

My question is:

how should we upgrade jQuery 1.8.3 to jQuery 1.9.0 without any problems in ASP.NET MVC 4 with merge enabled?

+4
source share
3 answers

Launch the application and from your browser view the source of the application - is it jQuery version 1.9.0 or 1.8.3?

In Visual Studio, if you go to "Tools" β†’ "Library Package Manager" β†’ "Manage Nuget Packages for Solution" ... then left-click on updates and you will see jQuery in the list - click on "Update".

As far as I know, this will take care of everything. Check the source again.

One more thing you can do: go to Solution Explorer -> App_Start -> BundleConfig.cs - make sure the first call to bundles.Add looks 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 the new package code - it’s obvious that you downloaded the transfer file.

+6
source

You must use Nuget to update. Tools -> Library Package Manager -> Managing Nuget Package Packages (stop debugging mode if you are 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 ...

+1
source

Just open the package manager console in the nuget package nuget and run the command:

 Install-package jQuery 
+1
source

All Articles