ASP.NET MVC2 JQuery datepicker errors
Posted
by Andy Evans
on Stack Overflow
See other posts from Stack Overflow
or by Andy Evans
Published on 2010-05-22T17:06:02Z
Indexed on
2010/05/22
17:10 UTC
Read the original article
Hit count: 793
asp.net-mvc-2
I'm having the "Microsoft JScript runtime error: Object doesn't support this property or method" error when calling the datepicker function on a textbox generated from my data model.
in the head section I have:
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#dob').datepicker();
});
and in the body section I have:
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm()) { %>
...
<tr>
<td class="label">Date of Birth:</td>
<td><%: Html.TextBoxFor(model => model.dob, new { @class = "inputtext" })%></td>
<td><%: Html.ValidationMessageFor(model => model.dob) %></td>
</tr>
...
<% } %>
Do I have something in the wrong place?
Again, you folks are a great help and assistance would be greatly appreciated.
© Stack Overflow or respective owner