JQuery giving the error "Object does not support this property or method" in the datepicker method

The script in the following partial ASP.NET view causes me an infinite amount of grief:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<AkwiMemorial.Models.CalendarModel>" %> <link href="../../Content/jquery.ui.all.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../../Scripts/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="../../Scripts/jquery.ui.core.js"></script> <script type="text/javascript" src="../../Scripts/jquery.ui.datepicker.js"></script> **<script type="text/javascript"> $(document).ready(function () { $('#datepicker').datepicker({ inline: true, onSelect: function(dateText, inst) { $('#DateStr').val(dateText); $('form').trigger('submit'); }}); }); </script>** <% using (Html.BeginForm()) { %> <div> <div id="datepicker" ></div> <%= Html.HiddenFor(x => x.DateStr)%> </div> <% } %> 

I tried using jQuery 1.4.4, 1.5.1 and 1.6.1, all to no avail. Of the many related posts I've come across, it seems like the datapick script is not loading. Why is it so, even if it is referenced?

+1
source share

Source: https://habr.com/ru/post/956041/


All Articles