1

In my current project I have quite a lot of customer things going on, so I wanted to organise it accordingly.

I wanted my controllers to look like the following:

/Controllers/Customer/CustomerController.cs
/Controllers/Customer/CustomerResourceController.cs
/Controllers/Customer/CustomerDataFieldController.cs

And my views to look like this:

/Views/Customer/Customer/Index.cshtml
/Views/Customer/CustomerResource/Index.cshtml
/Views/Customer/CustomerDataField/Index.cshtml

I'm not sure to map this, I tried something amongst the lines of this:

        routes.MapRoute(
            "customer_routing",
            "Customer/{controller}",
            new { controller = "Customer", action = "Index" } // Parameter defaults
        );

Which gets my controllers correctly (I think), but how do I map my views correctly?

Thanks, Thomas

Schoof
  • 2,715
  • 5
  • 29
  • 41
  • 1
    Look at: http://stackoverflow.com/questions/632964/can-i-specify-a-custom-location-to-search-for-views-in-asp-net-mvc or on this one: http://stackoverflow.com/questions/6840941/group-mvc3-views-into-sub-folders-under-main-action-folder – Piotr Stapp Apr 08 '13 at 09:47

1 Answers1

3

I think a good approach for you is to use areas, http://msdn.microsoft.com/en-us/library/ee671793(v=vs.98).aspx