Henriquee
❔ Razor MVC
public async Task<IActionResult> QualificationEpaeDelete(int id, OpportunityQualificationEpaeViewModel model)
{
var result = await _opportunityQualificationEpaeService.DeleteAsync(id);
FlashMessage.Success("CNPJ excluido com sucesso!");
return RedirectToAction(nameof(OpportunityQualificationEpae), new { opportunityId = model.OpportunityId });
}
20 replies
❔ Razor MVC
I believe so, I have a first form that serves to save the information from my inputs:
<form id="formQualification" asp-action="QualificationEpaeSave" class="col-12 d-flex flex-column justify-content-start">
So, if there is already an item in the db with the same ID, I search and retrieve them through the Model,
so I made a foreach to render them, and it's basically a crud, I made a delete function and I'm trying to apply it to my delete button, the only way I could make it work was by putting another form inside that foreach and doing the asp-action for my delete function, but due to having a form inside another form, there were some bugs, and then I found out that it is also a bad practice, so I would like to know if there is any way to put the function in my controller directly on my button
20 replies