mortenstarck
mortenstarck

Reputation: 2803

MVC project structuring

I have been looking for an solution for structuring my MVC5 project, but have not found anything yet. What i look for is. I have an Main Website, which off-course has it's own Views, Scripts and Controllers, but what is special is that i like to have sub Website projects which add an menu point in the main page, but the sub website also contains it's own Views, scripts and Controllers( I have tried to draw a picture of what i'm talking about ).enter image description here The point of this is to have an structured in a easy way. But also to reuse the same views in a framework way.

Upvotes: 0

Views: 75

Answers (1)

Manuel Schweigert
Manuel Schweigert

Reputation: 4974

You should be able to define an area in another project, found an article that explains in detail how it is done in MVC3, it should not be very different in later versions since areas and routing haven't changed a lot.

http://nileshhirapra.blogspot.no/2012/02/aspnet-mvc-pluggable-application.html

Update: you do not actually need to set up the project in the Areas folder, but you need to copy all content like views and scripts/css into there before being able to use it in the main application. If you want these sites to actually be separate websites but only look similar, then that is what you'd need to set up. You'd probably want to decide on a single-sign-on scheme for that.

Upvotes: 1

Related Questions