Does anyone know why I'm always getting a false value when I update the form? I tried with (value="false") into the checkbox but still doesn't work. Any help is appreciated!
<form asp-controller="Weather" asp-action="Update" method="POST">
<tr>
<td>@city.City</td>
<td><input type="number" name="cityId" value="@city.Id" hidden/></td>
<td><input type="checkbox" asp-for="@city.OnHeader" /></td>
<td><input type="checkbox" asp-for="@city.OnProfile" /></td>
<td><a asp-controller="Weather" asp-action="Delete" asp-route-cityId="@city.Id"><i class="fas fa-trash-alt color"></i></a></td>
<td><button type="submit"><i class="fas fa-edit color"></i></button></td>
</tr>
</form>
[HttpPost]
public IActionResult Update(WeatherModel theWeather, int cityId)
{
_weatherService.Update(cityId, theWeather.OnHeader, theWeather.OnProfile);
return RedirectToAction("Settings");
}