How to binding to bit datatype in SQL to Booleans/CheckBoxes in ASP.NET MVC 2 with DataAnnotations
- by nvtthang
I've got problem with binding data type boolean to checkbox in MVC 2 data annotations
Here's my code sample:
label>
Is Hot
</label>
<%=Html.CheckBoxFor(model => model.isHot, new {@class="input" })%>
It always raise this error message below at (model=model.isHot).
Cannot convert lambda expression to delegate type 'System.Func<Framework.Models.customer,bool>' because some of the return types in the block are not implicitly convertible to the delegate return type
Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)
Please suggest me how can I solve this problem?
Thanks in advance.