Why is the following code not working:
@Html.DisplayFor(modelItem => item.SupplierName.ToString().Replace("\"", ""))
I get following error:
System.InvalidOperationException was unhandled by user code
Inner exception:
Templates can be used only with field access, property access,
single-dimension array index, or single-parameter custom indexer expressions.
Is working with Templates
, like here in the following question on SO: replace character in text generated by html.displayfor, the only solution?
Looks strange to me to write templates only for formatting some text?