title: Using the jquery datepicker in ASP.Net MVC3 projects
body: <p>In <a href="http://blogs.msdn.com/b/stuartleeks/archive/2011/01/25/asp-net-mvc-3-integrating-with-the-jquery-ui-date-picker-and-adding-a-jquery-validate-date-range-validator.aspx" rel="nofollow">this blog</a> it should be explained how to implement the jquery datepicker for all DateTime inputs. I fail miserably however when I try to follow the steps taken. I suspect that I am setting the references wrong somewhere, as there are now already newer (and diffverently named) .js files in my VS project than those mentioned in the blog. Is there a place where the implementation is spoon fed for the absolute jquery NOOB? <p>
  EDIT:
  I also found <a href="http://forums.asp.net/t/1651924.aspx/1?Razor%20View%20datetimpicker%20for%20all%20date%20time%20fields" rel="nofollow">this link</a>. After copying in the code as mentioned I am greeted by an exception in jquery 1.5.1-min.js that says that the object doest not support that property or method...<p>
  EDIT(2)
  I am at my wits' end wth this one, I tried to add the references Tridus suggested, but I have different versions and of some versions I have a <em>.min.js</em> alternative. All the relevant code:<p>
  In StandIn.cs:</p>
  
  <pre><code>    [DisplayName("Available from")]
      [DisplayFormat(DataFormatString="{0:d}",ApplyFormatInEditMode=true,NullDisplayText="(not specified")]
      public DateTime? From { get; set; }
  </code></pre>
  
  <p>In Edit.cshtml:</p>
  
  <pre><code>       &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.Standin.From)
          @Html.ValidationMessageFor(model =&gt; model.Standin.From)
      &lt;/div&gt;
  </code></pre>
  
  <p>In _Layout.cshtml:</p>
  
  <pre><code>&lt;head&gt;
  &lt;title&gt;@ViewBag.Title&lt;/title&gt;
  &lt;link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" /&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery-1.5.1.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>In \Shared\EditorTemplates\DateTime.cshtml</p>
  
  <pre><code> @model Nullable&lt;System.DateTime&gt; 
  
  @if (Model.HasValue)
  {
      @Html.TextBox("", Model.Value.ToShortDateString(), new { @class = "date" }) 
  }
  else
  {
      @Html.TextBox("",string.Empty) 
  }
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () { $('.date').datepicker({ dateFormat: "dd/mm/yy" }); });
  &lt;/script&gt;
  </code></pre>
  
  <p>Mind: all the code performs without problems until I add the script tags: then on showing Edit.cshtml jquery-1.5.1.min.js throws an exception about a property or method not being supported.</p>