Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot install jQuery UI WIdgets:Datepicker

When following this tutorial (http://www.asp.net/mvc/tutorials/javascript/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc-part-4), I try to install the jQuery UI WIdgets:Datepicker via NuGet and get the following error:

Attempting to resolve dependency 'jQuery.UI.Core (= 1.8.9)'.

Attempting to resolve dependency 'jQuery (≥ 1.4.4 && < 1.6)'.

Successfully installed 'jQuery 1.4.4'.

Successfully installed 'jQuery.UI.Core 1.8.9'.

Successfully installed 'jQuery.UI.Widgets.Datepicker 1.8.9'.

Install failed. Rolling back...

Updating 'jQuery 1.7.1.1' to 'jQuery 1.4.4' failed. Unable to find a version of 'jQuery.UI.Combined' that is compatible with 'jQuery 1.4.4'.

This is presumably because I have jQuery 1.7.1.1 in the solution for something else. How can I get around this?

If I can't, is there another datepicker I can use in ASP .NET MVC 4 (which I am new to) with clear instructions on using?

like image 429
Geminirand Avatar asked Mar 11 '13 12:03

Geminirand


1 Answers

I had the exact same problem, so I downloaded the widget manually: http://jqueryui.com/download/

Extracted the folder and added the scripts I needed to my project:

  • \jquery-ui-1.10.2.custom\jquery-ui-1.10.2.custom\development-bundle\themes\base\jquery.ui.datepicker.css
  • \jquery-ui-1.10.2.custom\jquery-ui-1.10.2.custom\development-bundle\ui\jquery.ui.datepicker.js

The reason why Nuget failed the installation was because the package was trying to reference jquery.1.4 and MVC 4 needs a higher library.

Hope it helps...

like image 145
Bryan van Rijn Avatar answered Oct 06 '22 01:10

Bryan van Rijn