3

I have a MVC4 Webapp (1) with a Virtual Directory under it which contains another independent Webapp, like so:

 MainApp
     Areas
         SUBAPP  <------ THIS is a Virtual Directory with its own Webapp
             Views
                 _Layout_2.cshtml
     Views
         _Layout_1.cshtml

Now I would like to manage the Layouts of the SUBAPP from the MAINAPP like:

  _Layout_2.cshtml:
  @{
     Layout = "../../Views/_Layout_1.cshtml
   }

....which gives me the error:

  The virtual path '/Views/_Layout_1.cshtml' maps to another application,
  which is not allowed

How could I achieve this???

reinhard
  • 818
  • 1
  • 10
  • 24

1 Answers1

0

Have you tryed to place that layout in a /Views/Shared folder?

You can also try to use the MEF framework

http://msdn.microsoft.com/it-it/library/hh708870%28v=vs.110%29.aspx

is really simple to put it up and you can connect Views and Controller from other project and also other solution (it's like a plugin)

theLaw
  • 1,261
  • 2
  • 11
  • 23