Reputation: 3
I was just looking at How to add Date Picker Bootstrap 3 on MVC 5 project using the Razor engine?
But it failed for me, I got the error:
Unhandled exception at line 48, column 8 in http://localhost:10234/Venue/Edit/6a83811c-7a36-41f8-bc8e-8371d01f606e
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'datepicker'
The script I used is: $(function () { // will trigger when the document is ready $('.datepicker').datepicker(); //Initialise any date pickers });
With the highlighted text: $('.datepicker').datepicker()
This is how I declared the text box...
@Html.TextBoxFor(model => model.DateFrom, new { @class = "form-control datepicker", placeholder = "Enter date from here" } )
I expect that I have a simple setup error as I am new to Date Picker and Bootstrap
Any advice would be greatly appreciated - Thank You
Upvotes: 0
Views: 1987
Reputation: 1742
The datepicker is from the jQuery UI library. Have you included this one?
Upvotes: 1