I have an application that I put in as a new site and it worked perfectly, but by putting that application inside another, it gives an error in the route. I need to sign in when you sign in to " link " and it is pointing to " link ". Excerpt where it returns to the "PainelAdm" view:
[HttpPost]
public ActionResult LogOn(FormCollection f, string returnUrl)
{
Conta user = new Conta();
ContaModels atrrConta = new ContaModels();
atrrConta = user.RetornaUser(f["login"]);
if (user.AutenticaUser(atrrConta, f["senha"]))
{
//Rotina para autenticar usuario
if (returnUrl == "" || returnUrl == null)
{
returnUrl = "/CalendarioAlertaSMS";
}
System.Web.Security.FormsAuthentication.SetAuthCookie(atrrConta.Ide_Perfil.ToString(), false);
Session["PERFIL"] = atrrConta.Ide_Perfil;
Session["NOME"] = atrrConta.Nome;
if (Session["PERFIL"].ToString() == "ADMIN")
{
returnUrl = "/PainelAdm";
}
return Redirect(returnUrl);
}
else
{
ViewBag.Message = "Login ou senha inválidos.";
return View();
}
}