Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Please try this
<span epi-property="AddressLabel"></span>
@if (Model.AdditionalAddress != null)
{
@foreach (var addr in Model.AdditionalAddress)
{
<span>@addr.StreetAddress</span>
}
}
epi-property
should only be used with model properties directly, not within a loop or on dynamic values.
To output collection items, just use @addr.StreetAddress
instead of epi-property
.
Hello,
Can someone clarify what is wrong here. I have a model with two properties AddressLabel which is a string and Ilist<AddressBlock>.
On the view I have as following
<span epi-property="AddressLabel" />
@foreach(var addr in Model.AdditionalAddress)
{
<span epi-property="@addr.StreetAddress" />
}
I can debug this and values for StreetAddress is coming through, however in the rendered view, I can see the AddressLabel but the Street Address is rendered blank. Am I missing anything with epi-property tag helper