0
我有一個C#MVC3項目,並且無法實現HTML.CheckBoxFor。我提示以下錯誤: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>
}
}
任何想法?
@Jared ...謝謝 – MikeTWebb