Can someone please explain how to get values from all check boxes with the same name attribute from Request.Form object?
I have a View which has a List model. When I iterate through items, I display a Html.CheckBoxFor(modelItem => item.SomeBoolValue)
. Razor renders that value as a name of each checkbox
element.
On the server-side, in a Controller, I try to extract the information with Request.Form.Get("item.SomeBoolValue")
. It returns a series of trues and falses in a string. But when I try to access check boxes by index (Request.Form.Get("item.SomeBoolValue")[i]
), it returns a weird code (102f or 97a, for example).
How should I properly get values from check boxes needed for my logic? Please help, I am going crazy about this. Searched everywhere, tried everything.