这是我的观点,我发现了一个错误
@Html.EditorFor(model => model.FacebookId)
模型为空
但是在 var@Model
中,我的 viewModel 具有所有值
这是我的看法:
@model Registration.Front.Web.Models.RegistrationViewModel
@using Registration.Domain.Entities.Enum;
@using Registration.Front.Web.Helpers;
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Registration</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
@{string visibleFb = (!Model.FBParam) ? "display:none" : "display:inline";
<div id="fb" style="@visibleFb">
<div class="editor-label">
FacebookId
</div>
<div class="editor-field">
@Html.EditorFor(model => model.FacebookId)
</div>
</div>