jQuery UI Datepicker in MVC 4 Issue

Today, I spent a couple of hours in finding the best suited fix of this issue. Actually that was a very simple problem and we may fix it by adding another http request layer in the application but that was not a productive choice.


If you create a MVC 4 application using "Internet" template, you will find the "BundleConfig.cs" file in the "App_Start" folder; open it.



You will notice there is a total of 6 bundles (jQuery and CSS) being processed. Now, open the "_Layout.cshtml" file and look at this image:



You will notice only three bundles are added by default. We have to add 2 more to enable the use of Datepicker.



Note to use the same ordering.


Now, on the view page use as follows:




Now if you run the application you will see your Datepicker working.




Hope this helps. Thanks.

Up Next
    Ebook Download
    View all
    Learn
    View all