I have a Model with some complex Properties:
public class TestModel
{
public string Prop1 { get; set; }
public SubClass Prop2 { get; set; }
}
public class SubClass
{
public string Test { get; set; }
}
public class TestModelMetadata : ModelMetadataConfiguration<TestModel>
{
public TestModelMetadata ()
{
Configure(m => m.Prop1).DisplayName("is going to be displayed");
Configure(m => m.Prop2.Test).DisplayName("is NOT going to be displayed");
}
}
When i am trying to display the Model on the View:
@Html.LabelFor(m => m.Prop1)
@Html.LabelFor(m => m.Prop2.Test)
the correct Label for Prop1 is displayed, for Prop2.Test not.
does anybody know a solution for that? thanks!!!!!