I have encountered an issue in ASP MVC whereby I am attempting to access a View in the admin Area App/Areas/Admin/Account/Manage
, however the page sometimes serves the user profile page in the root namespace controller App/Account/Manage
.
It seems to be after I make a change to the admin View, but then works normally again after the debugger is restarted.
I am using RazorGenerator, so I suspect it's something to do with that, however I don't want to run the risk of another developer publishing the app without updating razor generator, and an admin having access to the users profile page.
All routes are being registered with AreaRegistration.RegisterAllAreas();
in the Global.asax file
The default route config includes the app namespace;
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "App.Controllers" }
);
And the admin area registration contains the routing;
context.MapRoute(
name: "Admin_default",
url: "Admin/{controller}/{action}/{id}",
defaults: new { action = "Index", id = UrlParameter.Optional },
namespaces: new[] { "App.Areas.Admin.Controllers" }
);
I have setup a break point, and can follow the code through the Admin controller, however as soon as the return View(model)
line is hit, it attempts to redirect to the user profile rather than the admin view.
Has anyone encountered something similar?