MVC Areas - View not found

前端 未结 8 1438
盖世英雄少女心
盖世英雄少女心 2020-12-15 08:35

I have a project that is using MVC areas. The area has the entire project in it while the main \"Views/Controllers/Models\" folders outside the Areas are empty barring a dis

8条回答
  •  时光说笑
    2020-12-15 08:48

    Try this code. Do changes in Area Registration File...

    context.MapRoute(
        "YourRouteName",   // Route name //
        "MyAreaName/MyController/{action}",   // URL with parameters //
        new { 
            controller = "MyControllerName", 
            action = "MyActionName", meetId =  UrlParameter.Optional
         },   // Parameter defaults
        new[] { "Your Namespace name" }
    );
    

提交回复
热议问题