Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a problem recovering the properties of a Tab called "Features".
With this code:
@foreach (var t in DynamicModel.Attributes) { if(t.AttributeDefinition.AttributeGroup.Name == "Features") { string propName = t.AttributeDefinition.Name; <h3>label: @propName</h3> } }
I get all the propertie's labels, but how i access to their values?
Thanks for answering
I guess you're on v5? I think you need
DynamicModel.Attributes[propName].DynamicValue
to retrieve the values for each of the properties.
Hope this helps.
Cheers,
/Dirk
Thanks a lot Dirk, That worked like a dream
@foreach (var t in DynamicModel.Attributes) { if (t.AttributeDefinition.AttributeGroup.Name == "Features") { string propName = t.AttributeDefinition.Alias; <h3> Prop: @DynamicModel.Attributes[propName].DynamicValue</h3> } }
the problem was AttributeDefinition.Name instead of AttributeDefinition.Alias ;)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get all properties of a Tab
I have a problem recovering the properties of a Tab called "Features".
With this code:
@foreach (var t in DynamicModel.Attributes)
{
if(t.AttributeDefinition.AttributeGroup.Name == "Features")
{ string propName = t.AttributeDefinition.Name;
<h3>label: @propName</h3>
}
}
I get all the propertie's labels, but how i access to their values?
Thanks for answering
I guess you're on v5? I think you need
to retrieve the values for each of the properties.
Hope this helps.
Cheers,
/Dirk
Thanks a lot Dirk, That worked like a dream
@foreach (var t in DynamicModel.Attributes)
{
if (t.AttributeDefinition.AttributeGroup.Name == "Features")
{ string propName = t.AttributeDefinition.Alias;
<h3> Prop: @DynamicModel.Attributes[propName].DynamicValue</h3>
}
}
the problem was AttributeDefinition.Name instead of AttributeDefinition.Alias ;)
is working on a reply...