I have a View that contains the following Line of code:
//(DaysOfWeek is a bool[])
@Html.CheckBoxFor(m => m.Data.DaysOfWeek[0])
It starts off as false. When the user "checks" the box and returns, it returns a value for both true and false;
Here is what is being passed back as part of the form data
Data.DaysOfWeek[0]:true
Data.DaysOfWeek[0]:false
Why is it doing that?
bool DayOfWeek0 = Data.DaysOfWeek[0]should be eithertrueorfalseif you're not using a view model, you could just do@Html.CheckBox("VariableName")and in your controller method argumentsbool VariableName