I am using this, an editor template (located in the Shared\EditorTemplates folder in my solution)
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.DateTime?>" %>
<%=Html.TextBox("", (Model.HasValue ? Model.Value.ToString("MM/dd/yyyy") : string.Empty), ViewData )%>
and this in my view
@Html.EditorFor(model => model.ModifiedDate)
how to make this field readonly in the view
UPDATE:
OK, now that you sent me the sample project here are the issues:
~/Views/Shared/EditorTempletesfolder. It should be~/Views/Shared/EditorTemplates.You editor template must be called
DateTime.ascxand not aDateTime.aspx. And because of this the header must look like this (use<%@ Control ...instead of<%@ Page ...):