-3
I have an application in which I put as a new site and it worked well, but when putting this application inside another, gives an error in the route. I need that when logging in, direct to "http://localhost:port/Documents/Panel" and he’s directing to "http://localhost:port/Paneeladm". Excerpt where it returns to the view "Paineladm":
[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();
}
}
Define "put application inside another". What would that be?
– Leonel Sanches da Silva
Have you made any modifications to Routeconfig.Cs ? Or are you using the default?
– Intruso
If possible, edit the issue by adding your Routeconfig.Cs code, I imagine you’re doing something wrong with it.
– Zignd
@Ciganomorrisonmendez, Dude that my problem I managed to solve, now the problem is, like, I have a site in classic Asp that through a button will call another application in mvc Asp.net. And I put this application in mvc inside the site that is in classic Asp. I need it to open through this site in classic Asp.
– AndreeH
@Intruder, no, I haven’t made any changes, there’s only one snippet where I’m checking the user profile, which if he has the administrator profile he returns a different home than users who don’t have that profile, and it’s at this point that I’m going through the one that I mentioned in the question.
– AndreeH
@Andreeh This is very crude. I would put each site in a different subdomain. MVC routes are not directories, and naturally IIS is lost when solving names.
– Leonel Sanches da Silva
@Romaniomorrisonmendez Beauty, I have done it, but how can I get the button of the site Classic Asp call this application mvc ?
– AndreeH
@Andreeh Make a request hard, no relative paths. It does not cease to be another site elsewhere.
– Leonel Sanches da Silva
@Ciganomorrisonmendez, can you give me an example of how I do this ?
– AndreeH
Ué, a link to http://meusite:port/
– Leonel Sanches da Silva
@Ciganomorrisonmendez Puts, I’ve tried this and it wasn’t. : S
– AndreeH
@Ciganomorrisonmendez doesn’t work either, man, I just need you to redirect it like "http://lmeu_site:door/Documents/Paineladm". How can I set a course for this to work on iis ?
– AndreeH
Different subdomains mean different virtual directories. You don’t understand this part?
– Leonel Sanches da Silva
@Gypsy.
– AndreeH