Redirecting Excess ASP NET MVC

0

I have a problem with the project, when I access the default route, I get the following error.

Esta página não está funcionando

Redirecionamento em excesso por localhost
Tente limpar os cookies.
ERR_TOO_MANY_REDIRECTS

The error happens when in my index, I redirect to another view of another controller , if I give return View() everything works.

namespace Portal.Web.Client.Controllers
{
    [RoutePrefix("")]
    [Route("{action=index}")]
    public class HomeController : Controller
    {
        [Route("")]
        [Route("index")]
        public ActionResult Index()
        {
            //algumas coisas

            if(condicao)
                return RedirectToAction("sign-in","user"); // fica "chamando" este método (Action) infinita vezes.
            else
                return View(); //tudo funciona
        }
    }
}

Does anyone have any suggestions as to why this is occurring, and how to solve it?

    
asked by anonymous 11.05.2017 / 19:42

1 answer

0

After reading this SO-en issue , I changed the

return RedirectToAction("sign-in","user");

for

 return Redirect("~/user/sign-in");

and it worked.

    
11.05.2017 / 20:14