I don’t why the Html.CheckBoxFor(x => x.IsChecked) helper was implemented. Why does it force you to have to use a bool value?
From what I seen the regular html input can have a "value" of any string. So why does the html helper limit you?
I am having a problem right now where I would love to change the "value" to store my GUID but since it only takes in a bool I can’t do this.
I see other people make a HiddenFor() to get around this but I just find this weird.
It’s because usually a checkbox has 2 states: checked and unchecked. Which is perfectly modeled by a boolean. Now I understand your pain and agree with you that this could be a bit of a limitation because the underlying
<input>HTML element allows for potentially any type. But this limitation is very easily workarounded by simply adding a boolean property to your view model and then bind the CheckBoxFor helper to this property.