I want to make it possible for me to access my admin page when typing:
I have decided to go with the area approuch. However it doesnt seem to work quite yet.
Ive created an Admin area and updated the route in the admin area registration. it looks like this:
context.MapRoute(
"Admin_default",
"Admin/{controller}/{action}/{id}",
new { area = "Admin", action = "Index", id = UrlParameter.Optional },
new string[] { "skylearn.Areas.Admin.Controllers" }
);
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
new string[] { "skylearn.Controllers"}
);
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}
however it seems that if i go to my url localhost:1337/admin the index file located in my HOME folder serviced by my HomeController wont load. These folders and controllers are also located inside the admin area.
any ideas why this is happening?
Try:
You did not specify a default area or controller for your route.