public async Task<IActionResult> OnPostAsync(){ if (!ModelState.IsValid) { for (int x = ThirdPartyInformations.Count -1; x >= 0; x--) { if (ThirdPartyInformations[x].HiddenEntry == true) { ThirdPartyInformations.RemoveAt(x); } } ModelState.Clear(); TryValidateModel(this); // <-- } if (!ModelState.IsValid || ....
public async Task<IActionResult> OnPostAsync(){ if (!ModelState.IsValid) { for (int x = ThirdPartyInformations.Count -1; x >= 0; x--) { if (ThirdPartyInformations[x].HiddenEntry == true) { ThirdPartyInformations.RemoveAt(x); } } ModelState.Clear(); TryValidateModel(this); // <-- } if (!ModelState.IsValid || ....