This extension is no longer supported, no new versions are being developed or planned to be released.
Extension source code and MVC source project for Visual Studio 2012+, .NET framework 4.0 and 4.5.
This plugin is just a simple extension of MVC class 'HtmlHelper', which is used for all Html helpers on MVC views. Since there is no supported CheckBoxList extension built into MVC (including MVC4), this plugin adds it.
Install-Package MvcCheckBoxList
@Html.CheckBoxListFor(model => model.CheckBoxListName, // Checkbox name value, can be inline string
model => model.ListOfYourData, // List<YourDataObject>() of checkboxlist options
entity => entity.FieldToUseAsCheckBoxValue, // Each option value field (from 'YourDataObject')
entity => entity.FieldToUseAsCheckBoxName, // Each option text field (from 'YourDataObject')
model => model.ListOfYourSelectedData) // List<YourDataObject>() of selected checkboxlist options
<input checked="checked" id="CheckBoxListName123" name="CheckBoxListName" type="checkbox" value="1">
<label for="CheckBoxListName123">Text 1</label>
<input id="CheckBoxListName124" name="CheckBoxListName" type="checkbox" value="2">
<label for="CheckBoxListName124">Text 2</label>
<input id="CheckBoxListName125" name="CheckBoxListName" type="checkbox" value="3">
<label for="CheckBoxListName125">Text 3</label>
See Examples and Documentation on Extension's Site