I have a model property:
[HiddenInput(DisplayValue = false)]
public string MyProperty { get; set; }
When I display the property, nothing is shown:
@Html.Display("MyProperty")
Note that as this is for display, I'm not attempting to use:
@Html.Editor("MyProperty")
It shows the value if I use:
@Html.Value("MyProperty")
...but this bypasses the DisplayTemplates.
I'm guessing that the MVC rendering logic has something to stop displaying values with my aforementioned [HiddenInput]
attribute, but if I wanted to do that explicitly I would use [ShowForDisplay(false)]
.
Any ideas?