I want to get the id's of all selected items, but I only get the first one in the action in the controller. I expected the values to come as a comma-separated list, but no.
Code:
@foreach (ICulture cult in await _genRepo.GetCulturesAsync())
{
<label>
<input type="checkbox" name="lang" id="lang" value="@cult.Id" /> @cult.DisplayName
</label>
}
Controller action method:
[HttpPost("siteAPI/SaveSiteLanguageAsync")]
public async Task<IActionResult> SaveSiteLanguageAsync([FromForm] Guid app, [FromForm] string lang)
{
...
}