问题:

找到多个与名为“Home”的控制器匹配的类型。

解决:

在代码中添加对应的命名空间代码即可。

namespace WebAppAreasDemo

{

public class RouteConfig

{

public static void RegisterRoutes(RouteCollection routes)

{

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

 

routes.MapRoute(

name: "Default",

url: "{controller}/{action}/{id}",

defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },

namespaces: new string[] { "WebAppAreasDemo.Controllers" }

);

}

}

}

相关网址:https://www.cnblogs.com/codefly/p/6565694.html

相关文章:

  • 2022-01-30
  • 2021-08-04
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-10
  • 2022-02-19
  • 2022-01-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案