我有一个 C# MVC3 项目并且在实现 HTML.CheckBoxFor 时遇到了麻烦。我收到以下错误
Cannot implicitly convert type 'string' to 'bool'
这是代码:
@{
List<Domain.LookupCostReductions> costReductions = ViewBag.CostReductions;
foreach (Domain.LookupCostReductions cr in costReductions)
{
@: <td style="border:0 ;vertical-align: top; ">
@Html.CheckBoxFor(x => x.CostReduction, cr.Description)
@cr.Description
@:</td>
}
}
有任何想法吗?