1
我有东西,我无法找到正确的语法:@if +拉姆达在编辑器中模板
/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>
希望目的很明确......我如何到达那里(对于这类事情很难谷歌)?
啊......我有机会获得模型。完善。谢谢! – ekkis 2011-05-10 02:06:44