3

I am having partial that renders:

@model List<AccessoryGroupModel>

I tried to create DxaPropertyMarkup() for items like this:

int i = 0;
@foreach (var item in Model)
{
    <div class="u-flow" @Html.DxaPropertyMarkup(() => item)>

or this:

<div class="u-flow" @Html.DxaPropertyMarkup(() => Model, i++)>

But nothing works. Any idea?

1 Answer 1

2

The Html.DxaPropertyMarkup extension method is intended for rendering (guess what... :-)) property markup. For that purpose, you should provide a lambda expression which resolves to a property of an Entity Model.

You are trying to provide it a lambda expression which resolves to the Model itself. That doesn't work, indeed.

Maybe you actually wanted to render entity markup? In that case, use Html.DxaEntityMarkup. That one does expect a lambda which resolved to a Model as a whole.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.