Вопрос

I have something for which I can't find the right syntax:

/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>

I hope the intention is clear... how do I get there (it's hard to google for this sort of thing)?

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top