开发者

jQuery giving error "Object doesn't support this property or method" on method datepicker

The script on the following ASP.NET partial view is causing me开发者_开发技巧 endless amounts 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 have tried using jQuery 1.4.4, 1.5.1 and 1.6.1, all to no avail. From the numerous related posts I have come across, it sounds like the datepicker script is not being loaded. Why so, even when it is referenced?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜