У меня работает.
Модель:
public class MyViewModel
{
public DateTime Date { get; set; }
}
Контроллер:
public class HomeController : Controller
{
public ActionResult Index()
{
return View(new MyViewModel
{
Date = DateTime.Now
});
}
}
Вид (~/Views/Home/Index.aspx
):
<%: Html.EditorForModel() %>
Шаблон редактора для MyViewModel (~/Views/Home/EditorTemplates/MyViewModel.ascx
):
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyApp.Models.MyViewModel>" %>
<%: Html.EditorFor(x => x.Date) %>
Шаблон редактора для DateTime (~/Views/Home/EditorTemplates/DateTime.ascx
):
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime>" %>
<div>Some markup to edit date</div>