我有一些我找不到正确语法的东西:
/Views/Shared/EditorTemplates/Component.cshtml
@model Website.Models.Component
<div class="editor-field">
@if (x => x.Name == "")
{
@Html.EditorFor(x => x.Name)
<button class="create">New</button>
}
else
{
@Html.DisplayFor(x => x.Name)
<button class="delete" value="@Model.Id">X</button>
}
</div>
我希望意图很明确......我如何到达那里(这种事情很难用谷歌搜索)?