In my model i have propery:
public DateTime CreatedFrom { get; set; }
In strongly typed view i what to show that date and make it editable (but only date,not time).
I use:
@Html.EditorFor(m=>m.CreatedFrom.ToShortDateString())
When i want to go to that view exception occures:
Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
How do it correctly?
Linquinze is right, the EditorFor is for an Expression and not a Func.
If you are trying to display a textbox though for your date you could use:
which I believe will achieve the same thing.