CheckBoxList.Core 1.1.0

.NET Standard 2.0
dotnet add package CheckBoxList.Core --version 1.1.0
NuGet\Install-Package CheckBoxList.Core -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CheckBoxList.Core" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CheckBoxList.Core --version 1.1.0
#r "nuget: CheckBoxList.Core, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install CheckBoxList.Core as a Cake Addin
#addin nuget:?package=CheckBoxList.Core&version=1.1.0

// Install CheckBoxList.Core as a Cake Tool
#tool nuget:?package=CheckBoxList.Core&version=1.1.0

Synopsis

Creates a multiselection check box list based on the provided item source.

Code Example

Controller

public IActionResult Index()
{
    List<CheckBoxItem> checkBoxItems = new List<CheckBoxItem>()
    {
        new CheckBoxItem(1, "Id 1: Unchecked Enabled", false, false),
        new CheckBoxItem(2, "Id 2: Checked Enabled", true, false),
        new CheckBoxItem(2, "Id 3: Unchecked Disabled", false, true),
        new CheckBoxItem(2, "Id 4: Checked Disabled", true, true)
    };

    return View(checkBoxItems);
}
public IActionResult Result(List<int> selectedIds)
{
    return View(selectedIds);
}

View

<check-box-list name="selectedIds" items="Model" template="Bootstrap3Basic"></check-box-list>
_ViewImports.cshtml
@addTagHelper *, CheckBoxList.Core

Style (Optional)

.checkbox {
}

label.checkbox {
}

label.checkbox > input {
}

Motivation

ASP.NET Core doesn't provide check box list tag helper which forces developers to write their own implementation. Therefore, I came with a tag helper that simplifies the developer's job so that they can focus on their domain rather creating their own.

Installation

Package Manager UI

In Solution Explorer, right-click References and choose Manage NuGet Packages.

Choose "nuget.org" as the Package source, select the Browse tab, search for CheckBoxList.Core, select that package in the list, and select Install:

Accept any license prompts.

If prompted to select a package management format, select PackageReference in the project file:

If prompted to review changes, select OK.

Package Manager Console

Select the Tools > NuGet Package Manager > Package Manager Console menu command. Once the console opens, check that the Default project drop-down list shows the project into which you want to install the package.

Enter the command Install-Package CheckBoxList.Core.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 1,512 1/20/2019
1.0.0 1,084 2/11/2018