M Kenyon II
M Kenyon II

Reputation: 4274

Looking for a design pattern to handle asp.net sub projects

I'd like to re-design my site with one ASP.Net solution, and a project for each of the main areas of the site. I would like a layout like this:

Main Project

-- Legal Section Project

--- Legal Main Page (Uses Main MasterPage)

--- Legal Sub Page (Uses Main MasterPage)

-- Administration Section Project

--- Main Admin (Uses Main MasterPage)

--- Second Admin (Uses Main MasterPage)

--- Third Admin (Uses Main MasterPage)

The way I'd like the site to work is that if a menu item from the Master page gets triggered, the sub pages even if in a different project, would be able to handle it first, perhaps asking the user to save before the event from the Master page gets handled.

Any samples out there like that?

ASP.Net 2.0 or 3/3.5 is fine. Would MVC or MVP work for this?

Upvotes: 0

Views: 216

Answers (2)

mgnoonan
mgnoonan

Reputation: 7200

If the two (or more) projects need to share so much, do they really need to be separate projects?

Using MVC3, you could have an Area setup just for the Admin functions and it would share the same login credentials as the rest of the site. The project structure would look more like this:

Main Project
|--Areas
  |--Admin
    |--Controllers
    |--Models
    |--Views
|--Controllers
|--Models
|--Views
    |--Layout.cshtml

You can even make "Legal" an area if you so choose.

To solve your event triggering, you can use inheritance in your controllers to determine which one is going to handle a particular event. For example, The AdminBaseController can inherit from the main site BaseController, etc.

Upvotes: 0

Daniel A. White
Daniel A. White

Reputation: 190976

Either MVC or WebForms will do this. However you will have to manage the stuff manually in the file system.

With MVC, there is a concept of an Area, but out-of-the-box, Areas must be in the same project. I strongly recommend MVC for this.

Upvotes: 1

Related Questions