I have a form that is generated from foreach .
part of form :
@foreach (var Expertise in Model.Expertises)
{
<div class="form-check">
<div class="form-check">
<input class="form-check-input" type="hidden" asp-for="@Model.Havetreatment.ExpertiseId" value="@Expertise.Id">
<input class="form-check-input" type="checkbox" asp-for="@Model.Havetreatment.HasExpertise">
<label class="form-check-label" for="@Expertise.Id">@Expertise.Name</label>
</div>
</div>
}
`
if I wanna get this from action as single class its work but if i wanna get it as param array ,list doest work
work :
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(Doctor doctor,Havetreatment havetreatment,Havetreatment havetreatment2,Havetreatment havetreatment3)
does not work :
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(Doctor doctor,Havetreatment[] havetreatments)
or :
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(Doctor doctor,params Havetreatment[] havetreatments)
or :
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(Doctor doctor,list<Havetreatment> havetreatments)
idont wanna use ajax, any help????
