2

Situation

I am working on an ASP.NET Web Forms project that was generated using the default Visual Studio 2012 project template. I have since then used NuGet to install jQuery UI version 1.10.0.

I need to update to jQuery UI 1.10.1 because there is a bug fix I need. According to the website, 1.10.1 is the current stable version. However, there is not a NuGet package available for this version!

I don't know why the NuGet package would lag behind the latest available stable release from the jQuery UI team on their website. (Yes, I realize there is probably a different team managing the nuget package itself... but it still seems like this needs to be kept up to date.... or the value of installing jQuery via NuGet is very limited.)

Question

How do I update jQuery UI (installed as a NuGet package) manually to 1.10.1 on my project?

I have already downloaded the latest 1.10.1 javascript files. Now.... when I look inside my ASP.NET Web Forms project, I see in the following files in the Scripts folder:

Existing jQuery files

So what should I do here... delete the following two files?

  • jquery-ui-1.10.0.js
  • jquery-ui-1.10.0.min.js

...and replace with these new files?

  • jquery-ui-1.10.1.js
  • jquery-ui-1.10.1.min.js

This doesn't seem like it would work.

The way jQuery is being include in my masterpage (from the default template generated by Visual Studio 2012) is like this:

MasterPage jQuery include

That JS bundle you see above, called "jquery.ui.combined" is auto-magically generated by some kind of hidden code. Go ahead and look through your project... you won't find anywhere obvious this bundle is defined. So if I add the latest JS files... it seems I have no way to define that they get used or bundled at all. They aren't the version that the NuGet package logic/code would be expecting!!!

Any ideas?

Another potential problem

When I downloaded jQuery UI 1.10.1, it also came with jQuery Core 1.9.1. As you will see above in my Scripts folder, it appears as if jQuery UI 1.10.0 goes hand-in-hand with jQuery Core 1.9.0. If I update jQuery UI..... do I also need to update to the matching jQuery Core as well? (These are separate NuGet packages)

Please answer this specifically

I would like for the answer to explain how to manually update the version of jQuery UI installed from NuGet package.... on an ASP.NET Web Forms project.

I think this would be useful so that in the future a developer can pull down the latest bug fixes as soon as they are included in a stable release on the jQuery UI website.... without needing to wait for the package to show up on the NuGet feed.

Jason Parker
  • 4,960
  • 4
  • 41
  • 52

3 Answers3

3

The jQuery UI team hasn't uploaded the version 1.10.1 for their package. I'm afraid you just have to wait until they release it.

If you can't wait, you can uninstall the current version of jQuery UI first, and then manually add the script files of version 1.10.1 into your project.

superkinhluan
  • 733
  • 7
  • 23
  • Thanks for the reply. I don't think I can just uninstall the jQuery nuget package.... because with a ASP.NET Web Forms project, it comes by default configured with four jQuery nuget packages. AspNet.ScriptManager.jQuery.UI.Combined, AspNet.ScriptManager.jQuery, jQuery, and jQuery UI (Combined Library)..... Then the default master page references these in an order that seems important. I figure uninstalling the jQuery nuget packages (all four of them) would cause all sorts of problems. – Jason Parker Feb 28 '13 at 22:28
  • Can you augment your answer to include details on how to "uninstall the current version of jQuery UI" without breaking the default ASP.NET Web Forms project? (For example, which of those four nuget packages I listed should be removed? What alterations to default master page would be required?) – Jason Parker Feb 28 '13 at 22:40
  • If you only want to upgrade jQuery.UI, then you only need to uninstall the jQuery UI package, and leave the other 3 intact. – superkinhluan Mar 04 '13 at 00:58
  • The thing is, out of those 4 default installed nuget packages... two of them mention jQuery UI. One is called "AspNet.ScriptManager.jQuery.UI.Combined". Another one is called "jQuery UI (Combined Library)". I guess I can just remove two of them and see what breaks. I'm afraid I will create some strange bug if Microsoft's code is relying on these two packages being intact. Especially the ScriptManager one! I don't even know specifically why there are two related to jQuery UI.. except Hao Kung mentioned something about deduping here: http://stackoverflow.com/a/12308618/940783 – Jason Parker Mar 04 '13 at 14:33
1

Work-around... although it seems like a bad approach....

I just opened up these files....

  • jquery-ui-1.10.0.js
  • jquery-ui-1.10.0.min.js

...and replaced the contents with the contents from these files:

  • jquery-ui-1.10.1.js
  • jquery-ui-1.10.1.min.js

I left the file names the same as they were. So even though the JavaScript files are named as version "1.10.0".... they are actually holding the code for version "1.10.1".

One of the reasons I think this might be a terrible idea

What happens if some other developer attempts to pull down my code from source control... and they use NuGet Package Manager to restore the packages they did not have yet. Wouldn't it pull jQuery UI nuget package and replace the JavaScript files I have modified with the ones from the nuget package? Then the page would start exhibiting the buggy behavior again, and no one would know why.

At the very least.... for now I can continue development with the bug fixed! It was very annoying... the overlay was appearing on top of the dialog and I couldn't interact with the page. Here is the bug that was fixed: http://bugs.jqueryui.com/ticket/8984

Jason Parker
  • 4,960
  • 4
  • 41
  • 52
1

Go To : Visual Studio -> Tools => Library Package => And Package Manager Setting Window opens Having Options as in ScreenshotNuget Manual Package Add

Click On Add (+) Button At Right Top And Inside Source Browser To Your Folder Location of Whatever Package of Nuget You HAve. Name is Whatever You Want And Press Ok

You Can See Now Your Package Into Extensions And Updates Window

To Install In Current Project

use Package Manager console : Install-Package ANd your package name

Vishal Sharma
  • 2,773
  • 2
  • 24
  • 36