ASP.NET MVC2中的文件夹结构

aka*_*ari 1 asp.net-mvc-2

我有MVC2的文件夹结构的问题

我怎么能用这种方式:
文件夹:
控制器
--Portal
----会计
------ CashController.cs
------ BankController.cs
---- HR
------ EmployeesController.cs模型
视图
--Portal
----会计
------现金
-------- Index.aspx
-------- List.aspx
------银行
---- ---- Index.aspx
------ HR
-------- Index.aspx
-------- Employee.aspx

我该如何使用这样的文件夹结构,如何使用正确的表单路由URL.

非常感谢

Man*_*ous 6

您可能需要考虑使用Areas并删除Portal文件夹,因为它只是一个包装器.

所以你最终会得到这样的东西:

-Areas
---Accounting
------Controllers
---------CashController.cs
---------BankController.cs
------Views
---------Cash
------------Index.aspx
------------List.aspx
---------Bank
------------Index.aspx
---HR
------Controllers
---------EmployeesController.cs
------Views
---------Employees
------------Index.aspx
------------Employee.aspx
Run Code Online (Sandbox Code Playgroud)

更多关于这里的区域

或者只使用您想要的任何结构并更改名称空间以匹配默认值(不推荐).