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?