Asp.net MVC 4 subsequent operations for creating an area in a new project, mvcarea
After creating an area in Asp.net MVC 4 in a new project, HomeController is often confused with the HomeController routing of the area. You need to manually set some places to prevent mvc from recognizing the default Routing Status.
Detailed steps:
1. Check whether AreaRegistration. RegisterAllAreas () has been automatically added to Global. asax and \ App_Start \ RouteConfig. cs. If it does not exist, go to step 2. Otherwise, go to step 2.
2. In \ App_Start \ RouteConfig. cs, add AreaRegistration. RegisterAllAreas ();
Public static void RegisterRoutes (RouteCollection routes) {routes. ignoreRoute ("{resource }. axd/{* pathInfo} "); AreaRegistration. registerAllAreas (); routes. mapRoute (name: "Default", url: "{controller}/{action}/{id}", defaults: new {controller = "Home", action = "Index ", id = UrlParameter. optional}, namespaces: new [] {"tew.vcapplication. controllers "});}
3. In \ App_Start \ RouteConfig. cs, check whether the default Controller namespace is explicitly specified in routes. MapRoute.
Namespaces: new [] {"tew.vcapplication. Controllers "}