A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mikhail-tsennykh/MvcCheckBoxList below:

mikhail-tsennykh/MvcCheckBoxList: Extends MVC HtmlHelper class so you can create POSTable checkbox list

This extension is no longer supported, no new versions are being developed or planned to be released. CheckBoxList(For) - a missing .NET MVC extension

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
Insert into your Razor view:
@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
This will render input:checkbox and label pairs, e.g.:
<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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4