I am attempting to POST multipile values to the Controller when using @Html.BeginForm
inside foreach but anything beside first selected checkbox is ignored.
When I check the browser devtools I can see that only thing posted is the first selected value despite mutiple selection
I have tried to pass values in both @Html.BeginForm
and @Html.CheckBox
and only the first one worked for the single value
<td>
@using (Html.BeginForm("AddDismissRule", "Home", new { Rule = item.HashDetails, RuleType = 5, Url = this.Request.RawUrl, Name = item.Message }))
{
@Html.CheckBox("checkResp", new { @class = "checkbox-trash" })
<input onclick=" toast(2, '@item.Message','Dismissing...')" id="submit-checkbox" type="submit" value="Submit" />
}
</td>
Maybe there is a simplier way to handle this?