Hello community, I am working on a project with c # in mvc, well within my controller are my actions of grading, editing and eliminating what I want is to capture the error or success messages after each action I have something but it does not show me in my template the messages do it in the url here my code
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult RegistroEditar(FormCollection form)
{
SEG_ROL_DTO oRol = new SEG_ROL_DTO
{
id_rol = Funciones.CheckInt(form["id_rol"]),
nombre = form["nombre"],
descripcion = form["descripcion"]
};
try
{
string estadoForm = oRol.id_rol > 0 ? "E" : "N";
SegRolBL.Grabar(estadoForm, oRol);
return RedirectToAction("Lista", "Rol");
}
catch (ApplicationException x)
{
ViewBag.mensaje = x.Message;
return RedirectToAction("RegistroEditar", "Rol", new { mensaje = x.Message, identificador = 1 });
}
catch (Exception e)
{
return RedirectToAction("RegistroEditar", "Rol", new { mensaje = e.Message, identificador = 2 });
}
}
Thanks for your help