Posts

Showing posts from December, 2012

Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.

If you're using ASP.NET MVC and are using the HTML helper DisplayFor or EditorFor to render a partial view and you, in runtime, get a nasty InvalidOperationException, saying ... Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions. ... it might be because you have been over-zealous and typed your Model object's property as an interface (say ICollection) instead of a concrete type (say List). Just sayin'.