asp.net mvc4 添加分区出现错误 找到多个与名为“home”的控制器匹配的类型

来源:互联网 发布:博途软件 编辑:程序博客网 时间:2024/05/16 14:36
在RouteConfig文件中添加命名空间可解决
 
routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new string[] { "Letter.Web.Controllers" }
            );

0 0
原创粉丝点击