我正在尝试向我添加“名称”属性,CheckBoxFor
但无法使其正常工作。
@Html.CheckBoxFor(
model => model.ProvidePracticalSuggestions,
new { @name = "help_practicalSuggestions"
})
知道我在这里做错了什么吗?
呈现的 HTML:
<div>
<input data-val="true" data-val-required="The Provide practical suggestions for implementing change, e.g. step-by-step best practices field is required." id="ProvidePracticalSuggestions" name="ProvidePracticalSuggestions" type="checkbox" value="true" /><input name="ProvidePracticalSuggestions" type="hidden" value="false" />
<span class="field-validation-valid" data-valmsg-for="ProvidePracticalSuggestions" data-valmsg-replace="true"></span>
<label for="ProvidePracticalSuggestions">Provide practical suggestions for implementing change, e.g. step-by-step best practices</label>
</div>