2010-09-11 133 views
1

我有MVC2文件夾結構MVC2

的文件夾結構的問題,我如何使用方式:
文件夾:
控制器
--Portal
----會計
------ CashController.cs
------ BankController.cs
---- HR
------ EmployeesController.cs 模式
查看
--Portal
----會計
------現金
-------- Index.aspx的
-------- List.aspx
------銀行
-------- Index.aspx的
------ HR
-------- Index.aspx的
----- --- Employee.aspx

我該如何使用這樣的文件夾結構,以及如何使用正確的路由URL形式。

非常感謝

回答

6

你可能要考慮使用領域和刪除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 

更多領域here

或者只是使用任何你想要的結構,改變namesspaces相匹配的默認值(不推薦)。