I'm using the <li><%= Html.CheckBox("IsPublic", false) %></li> checkbox. It creates <input id="IsPublic" name="IsPublic" type="checkbox" value=""><input name="IsPublic" type="hidden" value="false">.
I can't get it to return a true value. When checked, and submitted to a FromCollection, it's value is ",false" which still gets interpreted as false.
Without the checkbox I can have the Controller method be something like public JsonResult CreateThing(MyThing thing) and it correctly places all the fields. Now with the checkbox I'll have to manually set every field from the FormCollection unless I can get the checkbox to be automatically interpreted correctly.
I appreciate assistance.
Aucun commentaire:
Enregistrer un commentaire