3
Description: Error when compiling a resource needed to fulfill this request. Examine the error-specific details and modify the source code appropriately.
Compiler Error Message: CS1061: 'System.Web.Mvc.Htmlhelper' does not contain a definition for 'Checkboxlistfor' and no extension method 'Checkboxlistfor' accepts that a first argument of type 'System.Web.Mvc.Htmlhelper' is found (You are not using an Assembly guideline or reference?)
I already downloaded his Assembly, I even have in the references, but he makes this mistake.
And it would have to put together with this checkboxlist, radio Buttons and text inputs ?
Here is the view code:
@using MvcCheckBoxList.Model
@model MvcCheckBoxListForApp.Models.FruitViewModel
@{
ViewBag.Title = "Home Page";
}
<section class="checkBoxListFor">
<p>
<label>Please Select Fruits:</label>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
@Html.CheckBoxListFor(model => model.PostedFruits.FruitIds,
model => model.AvailableFruits,
fruit => fruit.Id,
fruit => fruit.Name,
model => model.SelectedFruits,
Position.Horizontal)
<input class="green" type="submit"
value="POST to Controller" />
}
</p>
</section>
Downloaded how? Installed the
package
via Nuget?– Leonel Sanches da Silva
Exactly, I tried both ways, both by the console, both by the Nuget.
– Érik Thiago