this how it looks when i run the code while ul closing inside for each和this how it should look like 当我编译代码时,此行中出现语法错误 @ Html.Raw(" item1.circleLevel)'>") 我不知道如何纠正它
int num = 0;
foreach (var item1 in Model)
{
if (num != item1.level)
{
num = item1.level;
@Html.Raw("<ul class=\"@Html.DisplayFor(modelItem => item1.circleLevel)\">")
foreach (var item in Model)
{
if (item1.level == item.level)
{
<li>
<a class="text" style="background-color: @Html.DisplayFor(modelItem => item.IsExest)" href="@Url.Action("Details", "Tree", new { id = item.User_ID })">@Html.DisplayFor(modelItem => item.Name)</a>
</li>
}
}
<li>
<div class="text" data-toggle="tooltip" data-placement="left" title="add family member">@Html.ActionLink("+", "Create")</div>
</li>
<ul class="circle5"></ul>
}
}
@Html.Raw("</ul>")
}