Call View on Another ASP.NET MVC Controller

0

I have 2 Controller's HomeController and UserController within UserController I have a method that validates the user.     If it is valid, I want it to redirect to the Index page of the HomeController But when I try to redirect it, it drops to the page:

link

Follow the redirect method to better illustrate the scenario.

var usuarioValido = _usuario.Login(email, senha);
        if (usuarioValido == true)
        {
           return RedirectToAction("~/Home/Index");
        }
        return View("Usuario Não encontrado");

How do I do this routing correctly?

    
asked by anonymous 16.08.2016 / 04:19

1 answer

2

The use of RedirectToAction is wrong. It's like this:

return RedirectToAction("Index", "Home");

See all possible uses here .

    
16.08.2016 / 04:42