tags:

views:

35

answers:

1

Please take careful consideration when reading this as I can see it getting easily confused.

Our current system has a set of menu options which are divided into areas (it's the areas of our business, in the same way you'd have accounts, personnel etc.). Some of these areas have blurred edges, i.e. a page may belong to both accounts and personnel, but it should exist in the relative menus. So, for example, a list of all company users may belong in both personnel and accounts, and managing these users by deleting, editing, adding, changing details from different tables is all dealt with in both areas.

What I need to know is how to allow blurring of these edges because I have different controllers in different areas (I'm using Haack's areas lib) but needing to pull back the same views. So http://localhost/Personnel/UserProfiles/MyProfile/Edit may also need to be in http://localhost/Accounts/StaffProfiles/TheirProfile/Edit. I'm using MvcSiteMap so you can't have duplicate elements in there.

Has anyone come across this problem and had to share views across multiple areas yet still maintain the same functionality? What solutions are available?

+1  A: 

If you need a shared view simple put the view file in the view/shared folder so that all controller's can get to it.

Tony Borf
I never this of this, I'll try it out today and mark this as right if so.
Kezzer
MVC does not just look in the view folder that matches the controller it also looks in the shared folder. To see this, rename the about.aspx page in the home folder then run the app and view the about page. The error message will display the search path.
Tony Borf