Html.CheckBoxfor()for循环中不显示复选框

时间:2019-10-24 19:07:40

标签: c# asp.net for-loop checkbox html-helper

尝试遍历我视图中的列表以显示用户首选项以及是否受到干扰。

在我看来,这是我现在拥有的:

 @for (var i = 0; i < Model.IdentityFields.FieldDefinitions.Count(); i++)
            {
                @Html.HiddenFor(m => m.IdentityFields.FieldDefinitions[i].Id)
                @Html.CheckBoxFor(m => m.IdentityFields.FieldDefinitions[i].IsActivated)
                @Html.Raw(Model.IdentityFields.FieldDefinitions[i].Name)
                @Html.Raw(Model.IdentityFields.FieldDefinitions[i].ApiKey)
                <br/>
            }

但是不会显示复选框。

enter image description here

任何人都可以看到我在这里做错了什么吗? 感谢您的帮助!

编辑: 这是html渲染器:

enter image description here

enter image description here

0 个答案:

没有答案
相关问题