当前位置: 代码迷 >> ASP.NET >> VIEW与Controllers多层文件夹时,Controllers怎么定向VIEW
  详细解决方案

VIEW与Controllers多层文件夹时,Controllers怎么定向VIEW

热度:8623   发布时间:2013-02-25 00:00:00.0
VIEW与Controllers多层文件夹时,Controllers如何定向VIEW
例如:项目ProA
(VIEW) 文件夹 Brand -- 文件夹Sign -- index.cshtml
(Controllers) 文件Brand -- SignController.cs
C# code
        routes.MapRoute(                "Brand",                "Brand/{controller}/{action}/{id}",                new { controller = "Brand.Sign", action = "index", id = UrlParameter.Optional }                );

现在请问:在SignController 中的 index中 return View(CustInfo)时, MVC 3 会直接去找 VIEW-文件夹Sign下的index.cshtml,
直接跳过了文件夹 Brand ,提示错误,如何解决?

------解决方案--------------------------------------------------------
楼主用area把,否则是不可以用二级目录的,博客园里有一篇文章介绍这个,建议你去找找./
  相关解决方案