My FormCollection is returning back a Checkbox, but I am after the value
collection["SelectedCheckbox"]
this returns "true,false"
but I want the results, which should be either true or false
My FormCollection is returning back a Checkbox, but I am after the value
collection["SelectedCheckbox"]
this returns "true,false"
but I want the results, which should be either true or false
in asp.net-mvc you would have to check for false
, the reason you check for false because the Html Checkbox
helper does some kind of freaky thing for value true
True returns as:
it makes the string read "true, false"
so you may have thought it was two values but its just one and means true
False returns as:
it makes the string read "false"