For example I have the DeleteUsers driver whose view is DeleteUsers.cshtml and another where the driver is Users and the view is Users.cshtml what I want is to pass the value of ViewBag.Error in DeleteUsers (controller) to Users (Vista) for there to be able to show the error
namespace Sistema.Controllers
{
public class Usuarios : Controller
{
public ActionResult Usuarios()
{
return(db.Usuarios.Tolist())
}
public ActionResult EliminarUsuario
{
// ?????????????????aquí regresar a la vista
// Usuarios con el valor de ViewBag.Error
}
}
}
/////////////Vista Usuarios
@model IEnumerable<Sistema.Models.Usuario>
@{
ViewBag.Title = "Usuarios";
}
///Recibir valor de ViewBabag
@ViewBag.Error