views:

48

answers:

1

Hi all,

I have a problem with folder structure of MVC2

How can I use that way:
Folder:
Controllers
--Portal
----Accounting
------CashController.cs
------BankController.cs
----HR
------EmployeesController.cs Models
Views
--Portal
----Accounting
------Cash
--------Index.aspx
--------List.aspx
------Bank
--------Index.aspx
------HR
--------Index.aspx
--------Employee.aspx

How can I use folder structure like that and how can I route the URL with the right form.

Many Thanks

+6  A: 

You might want to consider using Areas and dropping the Portal folder since it's just a wrapper.

So you will end up with something like this :

-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

More on Areas here

Or just use any structure you want and change the namesspaces to match the default (not recommended).

Manaf Abu.Rous