Call View in another ASP.NET MVC Controller

Asked

Viewed 4,054 times

0

I have 2 Controllers Homecontroller and User controller inside User controller I have a method that validates the user. If it’s valid, I want it redirected to the page Index of Homecontroller But when I try to redirect, it falls on the page:

http://localhost:62378/Usuario/Home/Index

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 I do this routing correctly ?

1 answer

2


Browser other questions tagged

You are not signed in. Login or sign up in order to post.