2
Inside the Controller folder of my MVC project I created a subfolder called Entries, which contains within 1 controller called Entries (home page of the registration module) and the other controllers of each page.
Inside the view folder, I have a similar structure, where inside the Register subfolder I have the Index view (for the initial page) and the other views of the module.
In the route configuration file, I left it as follows:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Cadastros",
url: "Cadastros/{controller}/{action}/{id}",
defaults: new { controller = "Cadastros", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "Aperam.PCP.PNB.UI.Controllers.Cadastros" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "Aperam.PCP.PNB.UI.Controllers" }
);
I have other controllers who are outside the registration subfolders, for example Consult a.
It works properly when I try to access the addresses:
localhost:63892/Cadastros
localhost:63892/Cadastros/MotivoRealocacao
localhost:63892/ConsultaUM
However, when I perform any operation on the ONE query screen, it reloads the page with the link localhost:63892/Cadastros/ConsultaUM
.
In the return of the search action for example, the return of the controller is
return View("Index", consultaUm);
Does anyone know where I’m going wrong?
ConsultaUM
is in which Controller?– Leonel Sanches da Silva
Query is a controller that is in the root of the Controller folder
– Carlos Henrique Biazin Esteves