Hi, I’m trying to use checkbox but I found strange behaviour. I’m using ASP NET Core 2. When I post the data, the field of corresponding value in the model has always value true.
<jqx-checkbox theme="@ViewBag.Theme" id="IsWarrantyAppliedCheckbox" name="IsWarrantyApplied"></jqx-checkbox>
public async Task<IActionResult> CheckDefects(int id, CheckDefectsViewModel model)
{
if (!model.IsWarrantyApplied)
RedirectToAction("NoWarranty");
RedirectToAction("WarrantyApplied");
}
In the example above the RedirectToAction(“NoWarranty”) is never called because model.IsWarrantyApplied is always true, regardless IsWarrantyAppliedCheckbox is checked or not.
Any help please?
Thanks