In MVC Razor view, I am trying to format a DateTime field to display time only. Using below code I am getting error \"Templates can be used only with field access, property acce
DisplayFor expects an expression that identifies the object that contains the properties to display. It will use built in, or custom, templates to render that display. You trying to provide the display logic as that expression parameter, which is not valid.
Use
@String.Format("HH:mm:ss", Model.row.LastUpdateDate)
or
@Model.row.LastUpdateDate.ToString("HH:mm:ss")