首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-06-06 
VIEW与Controllers多层文件夹时,Controllers如何定向VIEW例如:项目ProA(VIEW) 文件夹 Brand -- 文件夹Sign

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把,否则是不可以用二级目录的,博客园里有一篇文章介绍这个,建议你去找找./

热点排行