This is what I did on the view. I put @Html.CheckBox("checkBox", false, "Name")
in a jQuery UI tab.
But on the rendered html, this checkbox control was evaluated as a html string
<input 开发者_如何学运维id="checkBox" name="checkBox" type="checkbox" value="true" /><input name="checkBox" type="hidden" value="false" /><label for="checkBox">Name</label>
rather than a control. Any idea?
The default for Html.CheckBox also creates a hidden input tag.
This will return the value you get when the checkbox is not checked. Due to the nature of html, if a checkbox is not checked, nothing will be posted. So this is the easiest workaround.
精彩评论