0

We have an ASP.NET MVC project to serve as a master portal. The portal has links to controllers/views in other ASP.NET MVC projects. When the link is clicked, we want to a view from a different MVC project is loaded into the body of the master portal.

We know ASP.NET MVC provides Area within the MVC project to organize related functionality into a group functions. But instead everything in a project, we prefer to have related functionality into a separate project but they share the same master portal.

Is it doable within ASP.NET MVC and how?

1 Answers1

0

Depend on what is your exact requirement,

  1. If you want to share only data between projects expose controller actions and share the data by means of JSON.

  2. Sharing UI between project may not come handy in the long run.

Before anything, have a look at this article

Always there is way to do everything in programming, but consider performance and best practices to keep your application long living.

  • Thanks for your answer. Yes, we looked at the concept of Area in MVC framework but it is not ideal. What we try to build a master portal/page, which displays links to different/separate applications. Once a link is clicked, it launches the application. But we want the application to be rendered within the body of the portal/master pages. – Richard Dec 27 '16 at 16:13
  • if you own(or if the site is static) the all other sites which your planning to frame with a master page, try with i frame concept(easy way) where your contents will be loaded in to the iframe which is place in the master page as user the clicks any link.(Consider Cross-Site Scripting). Other way with MVC is : 1) https://forums.asp.net/t/1242500.aspx?How+to+have+Master+Page+and+Content+Page+in+different+projects 2) http://stackoverflow.com/questions/31920735/how-to-use-partial-view-from-another-project-in-asp-net-mvc –  Dec 28 '16 at 05:09