I want to create a checkbox in my MVC site for a particular field, however the field is stored in the model as a byte rather than a bool. So when I try to use CheckBoxFor like
@Html.CheckBoxFor(model => model.type)
it complains that it can't convert from a byte to a bool.
I changed it to instead say:
@Html.CheckBoxFor(model => Convert.ToBoolean(model.type))
But then when running the site I get an error of Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.
Can someone help or point me to the right place to fix this issue?