0
Good evening, I tried looking in other posts and did not find the answer. I have a Controller in my Asp Net MVC project that has this condition:
if (resultado == null)
{
ModelState.AddModelError("", "Usuário ou senha inválidos");
return RedirectToAction("Index", "Nav");
}
else
{
if (produto != null)
{
carrinho.AdicionarItem(prod, quantidade);
}
return RedirectToAction("Index", "Nav");
}
}
I tried several ways to put a message in case the condition gets in the IF, to display an alert message to the user, but I can’t. I tried with Tempdata but showed written only, wanted an alert or Pop Up alert. I tried last with Modelstate and put the @Html.Validationsummary() in the view, but it also didn’t show Pop-Up. I tried with Flashmessage and I couldn’t either. Can someone please help me?