title: ASP.Net MVC 3 EditorTemplate for DateTime Fields Error
body: <p>This code was converted from some ASP.Net MVC 2 code in this tutorial:<br>
  <a href="http://geekswithblogs.net/michelotti/archive/2010/02/05/mvc-2-editor-template-with-datetime.aspx" rel="nofollow">MVC 2 Editor Template with DateTime</a></p>
  
  <p>It is a custom EditorTemplate for DateTime fields stored as 'EditorTemplates/DateTime.cshtml'.</p>
  
  <pre><code>@Model DateTime?
  @Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty), new { @class = "datePicker" })
  </code></pre>
  
  <p>However I get the following error when using <code>@Html.EditorFor(model =&gt; model.NewAbsence.StartDate)</code>:</p>
  
  <p><strong>CS1973: 'System.Web.Mvc.HtmlHelper' has no applicable method named 'TextBox' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.</strong></p>
  
  <p>I've seen some similar posts on here which mention casting the parameter of the EditorFor method, however I cannot seem to get this to work in my example. </p>
  
  <p>Could someone please point out what I will need to change in my code. Thanks.</p>