Controller does not pass route value to ASP.NET MVC View

1

Based on my previous question: Problem with page return according to profile C # When accessing the system with another user with the "ADMIN" Profile, the controller return does not fall into the view and does not call the page route that should return. Already accessing with the "System Administrator" works. What could be happening?

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(f["login"], false);

                Session["PERFIL"] = atrrConta.Ide_Perfil;
                if (Session["PERFIL"].ToString() == "ADMIN")
                {
                    returnUrl = "../PainelAdm";
                }

                return Redirect(returnUrl);
            }
            else {
                ViewBag.Message = "Login ou senha inválidos.";
                return View(); 
            }
        }
    
asked by anonymous 24.06.2015 / 20:22

0 answers